From: Guillaume Abrioux Date: Tue, 23 Mar 2021 08:04:51 +0000 (+0100) Subject: tests: fix `test_rgw_is_up` test X-Git-Tag: v6.0.3~29 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=439cb79e3e32e8ad279c6d7b8c2d015570eb450c;p=ceph-ansible.git tests: fix `test_rgw_is_up` test The data structure seems to have been modified in ceph@master (quincy). This commit update the test accordingly. Signed-off-by: Guillaume Abrioux (cherry picked from commit b8080bac41f7604c3f37a2db214e4091f64720b4) --- diff --git a/tests/functional/tests/rgw/test_rgw.py b/tests/functional/tests/rgw/test_rgw.py index 4b7af28d2..958450d4e 100644 --- a/tests/functional/tests/rgw/test_rgw.py +++ b/tests/functional/tests/rgw/test_rgw.py @@ -36,14 +36,14 @@ class TestRGWs(object): cluster=cluster ) output = host.check_output(cmd) - daemons = [i for i in json.loads( - output)["servicemap"]["services"]["rgw"]["daemons"]] - for i in range(int(node["radosgw_num_instances"])): - instance_name = "{hostname}.rgw{seq}".format( - hostname=hostname, - seq=i - ) - assert instance_name in daemons + keys = [i for i in json.loads( + output)["servicemap"]["services"]["rgw"]["daemons"].keys()] + keys.remove('summary') + daemons = json.loads(output)["servicemap"]["services"]["rgw"]["daemons"] + hostnames = [] + for key in keys: + hostnames.append(daemons[key]['metadata']['hostname']) + @pytest.mark.no_docker def test_rgw_http_endpoint(self, node, host, setup):