Skip to content

Commit

Permalink
Merge pull request #888 from leonidc/test_no_listeners
Browse files Browse the repository at this point in the history
test no-listeners feature
  • Loading branch information
leonidc authored Oct 15, 2024
2 parents 77dc3f5 + d9e314b commit ccb8af9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cli_change_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def create_namespaces(caplog, ns_count, subsys):
cli(["--server-port", "5501", "namespace", "add", "--subsystem", subsys, "--rbd-pool", pool, "--rbd-image", f"{image}{i}", "--size", "16MB", "--rbd-create-image", "--load-balancing-group", anagrpid2])
assert f"Adding namespace {i} to {subsys}: Successful" in caplog.text

def try_change_one_namespace_lb_group_no_listeners(caplog, subsys, nsid_to_change, new_group):
caplog.clear()
cli(["--server-port", "5502", "namespace", "change_load_balancing_group", "--subsystem", subsys, "--nsid", nsid_to_change, "--load-balancing-group", new_group])
time.sleep(8)
assert "is owned by gateway None so try this command from it" in caplog.text

def change_one_namespace_lb_group(caplog, subsys, nsid_to_change, new_group):
caplog.clear()
cli(["--server-port", "5502", "namespace", "change_load_balancing_group", "--subsystem", subsys, "--nsid", nsid_to_change, "--load-balancing-group", new_group])
Expand Down Expand Up @@ -169,6 +175,10 @@ def test_change_namespace_lb_group(caplog, two_gateways):
assert f'"w_mbytes_per_second": "0",' in caplog.text
assert f'"no_auto_visible": false,' in caplog.text
assert f'"hosts": []' in caplog.text
try_change_one_namespace_lb_group_no_listeners(caplog, subsystem, "1", anagrpid2)
caplog.clear()
cli(["--server-port", "5502", "listener", "add", "--subsystem", subsystem, "--host-name", "GatewayBB", "--traddr", "127.0.0.1", "--trsvcid", "4420"])
cli(["--server-port", "5501", "listener", "add", "--subsystem", subsystem, "--host-name", "GatewayAA", "--traddr", "127.0.0.1", "--trsvcid", "4430"])
change_one_namespace_lb_group(caplog, subsystem, "1", anagrpid2)
caplog.clear()
cli(["--server-port", "5501", "--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "1"])
Expand Down

0 comments on commit ccb8af9

Please sign in to comment.