From: Varsha Rao Date: Tue, 30 Jun 2020 10:55:20 +0000 (+0530) Subject: qa/tasks/test_nfs: Add test for cluster info X-Git-Tag: v15.2.5~166^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8b231bd596f73e53436e60d0d8980f6eba37f79;p=ceph.git qa/tasks/test_nfs: Add test for cluster info Signed-off-by: Varsha Rao (cherry picked from commit 93aa5e4012e232d935884a8c69396684efc274e3) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 62e0a6b5cf44..3631c267ce12 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()