From: John Mulligan Date: Mon, 22 Aug 2022 15:00:49 +0000 (-0400) Subject: cephfs/test_nfs: adapt _test_list_cluster to expect JSON output X-Git-Tag: v18.1.0~491^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=57e94dd5028f430b15b76aa392df2d7eee35fd8d;p=ceph.git cephfs/test_nfs: adapt _test_list_cluster to expect JSON output 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 --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 4d6bf9f1858a..58490dea86a9 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -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): '''