Skip to content

Commit

Permalink
tmp: try t2 (+cartridge) tests
Browse files Browse the repository at this point in the history
empty now
  • Loading branch information
mandesero committed Sep 30, 2024
1 parent 6d22e37 commit 78821f6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/integration/status/test_custom_app/init.lua
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions test/integration/status/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == ""

0 comments on commit 78821f6

Please sign in to comment.