tests: fix `test_rgw_is_up` test
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 23 Mar 2021 08:04:51 +0000 (09:04 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 23 Mar 2021 18:58:27 +0000 (19:58 +0100)
The data structure seems to have been modified in ceph@master (quincy).

This commit update the test accordingly.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
tests/functional/tests/rgw/test_rgw.py

index 4b7af28d2f18ccd8a17089870e424962a6d778dc..958450d4e4b8882f30e8659b01b030514e61e846 100644 (file)
@@ -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):