diff --git a/test/integration/status/test_custom_app/init.lua b/test/integration/status/test_custom_app/init.lua new file mode 100644 index 000000000..c7159f3ae --- /dev/null +++ b/test/integration/status/test_custom_app/init.lua @@ -0,0 +1,11 @@ +local fiber = require('fiber') +local fio = require('fio') + +box.cfg({}) + +fh = fio.open('ready', {'O_WRONLY', 'O_CREAT'}, tonumber('644',8)) +fh:close() + +while true do + fiber.sleep(5) +end diff --git a/test/integration/status/test_status.py b/test/integration/status/test_status.py index 2c99b7d71..e60e71f70 100644 --- a/test/integration/status/test_status.py +++ b/test/integration/status/test_status.py @@ -278,3 +278,43 @@ def test_t3_no_instance_names_no_config(tt_cmd, tmpdir_with_cfg): assert status_out[app_name]["UPSTREAM"] == "--" finally: stop_application(tt_cmd, app_name, app_path) + + +@pytest.mark.skipif(tarantool_major_version > 2, + reason="skip custom test for Tarantool > 2") +def test_status_custom_app(tt_cmd, tmpdir_with_cfg, flag): + tmpdir = tmpdir_with_cfg + app_name = "test_custom_app" + app_path = os.path.join(tmpdir, app_name) + shutil.copytree(os.path.join(os.path.dirname(__file__), app_name), app_path) + try: + # Start a cluster. + start_cmd = [tt_cmd, "start", app_name] + rc, out = run_command_and_get_output(start_cmd, cwd=tmpdir) + assert rc == 0 + + # Check for start. + file = wait_file(os.path.join(tmpdir, app_name), 'ready', []) + assert file != "" + + status_cmd = [tt_cmd, "status"] + status_cmd.append("test_custom_app") + + rc, out = run_command_and_get_output(status_cmd, cwd=tmpdir) + assert rc == 0 + assert out == '' + finally: + stop_application(tt_cmd, app_name, tmpdir) + + +@pytest.mark.skipif(tarantool_major_version > 2, + reason="skip cartridge test for Tarantool > 2") +@pytest.mark.parametrize("target", [cartridge_name, f"{cartridge_name}:router"]) +def test_status_cartridge(tt_cmd, cartridge_app, flag, target): + rs_cmd = [tt_cmd, "status"] + rs_cmd.append(target) + + time.sleep(20) + rs_rc, rs_out = run_command_and_get_output(rs_cmd, cwd=cartridge_app.workdir) + assert rs_rc == 0 + assert rs_out == ""