]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs/test_nfs: adapt _test_list_cluster to expect JSON output
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 22 Aug 2022 15:00:49 +0000 (11:00 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jan 2023 18:44:11 +0000 (13:44 -0500)
Previously, the '... nfs cluster ls' command emitted newline separated
list of cluster names. For consistency with other module commands
reporting via JSON the cluster ls mgr function now emits JSON. Update
the test to match the new behavior of the module.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
qa/tasks/cephfs/test_nfs.py

index 4d6bf9f1858a3391abdf0e0f7a347a1e42e38117..58490dea86a95c24b57f4d13c72ae45a854e0425 100644 (file)
@@ -165,12 +165,13 @@ class TestNFS(MgrTestCase):
         it checks for expected cluster id. Otherwise checks nothing is listed.
         :param empty: If true it denotes no cluster is deployed.
         '''
+        nfs_output = self._nfs_cmd('cluster', 'ls')
+        jdata = json.loads(nfs_output)
         if empty:
-            cluster_id = ''
+            self.assertEqual(len(jdata), 0)
         else:
             cluster_id = self.cluster_id
-        nfs_output = self._nfs_cmd('cluster', 'ls')
-        self.assertEqual(cluster_id, nfs_output.strip())
+            self.assertEqual([cluster_id], jdata)
 
     def _create_export(self, export_id, create_fs=False, extra_cmd=None):
         '''