From 93aa5e4012e232d935884a8c69396684efc274e3 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Tue, 30 Jun 2020 16:25:20 +0530 Subject: [PATCH] qa/tasks/test_nfs: Add test for cluster info Signed-off-by: Varsha Rao --- qa/tasks/cephfs/test_nfs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 62e0a6b5cf446..3631c267ce121 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -360,3 +360,17 @@ class TestNFS(MgrTestCase): # Command should fail for test to pass if e.exitstatus != errno.ENOENT: raise + + def test_cluster_info(self): + ''' + Test cluster info outputs correct ip and hostname + ''' + self._test_create_cluster() + info_output = json.loads(self._nfs_cmd('cluster', 'info', self.cluster_id)) + host_details = {self.cluster_id: [{ + "hostname": self._sys_cmd(['hostname']).decode("utf-8").strip(), + "ip": list(set(self._sys_cmd(['hostname', '-I']).decode("utf-8").split())), + "port": 2049 + }]} + self.assertDictEqual(info_output, host_details) + self._test_delete_cluster() -- 2.39.5