tests: fix `test_nfs_is_up` test
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 22 Mar 2021 16:54:27 +0000 (17:54 +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/nfs/test_nfs_ganesha.py

index 42e1b891812d232c904dadd946ee8900d53755fa..b3c92ebafb0416cc77e9fcd9cd92daaeea3beb81 100644 (file)
@@ -38,9 +38,14 @@ class TestNFSs(object):
             cluster=cluster
         )
         output = host.check_output(cmd)
-        daemons = [i for i in json.loads(
-            output)["servicemap"]["services"]["rgw-nfs"]["daemons"]]
-        assert hostname in daemons
+        keys = [i for i in json.loads(
+            output)["servicemap"]["services"]["rgw-nfs"]["daemons"].keys()]
+        keys.remove('summary')
+        daemons = json.loads(output)["servicemap"]["services"]["rgw-nfs"]["daemons"]
+        hostnames = []
+        for key in keys:
+            hostnames.append(daemons[key]['metadata']['hostname'])
+
 
 # NOTE (guits): This check must be fixed. (Permission denied error)
 #    @pytest.mark.no_docker