From: Varsha Rao Date: Wed, 9 Dec 2020 16:52:50 +0000 (+0000) Subject: qa/tasks/cephfs/nfs: Check if host ip is in cluster info output X-Git-Tag: v15.2.9~9^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=99e1088bb9f3ace6aa0c97130a9a79944dac3d0a;p=ceph.git qa/tasks/cephfs/nfs: Check if host ip is in cluster info output Along with host IP, sometimes Docker container IP's shows up in 'hostname -I' output. Since this output is variable. Just check if host IP is present in the cluster info output. Fixes: https://tracker.ceph.com/issues/48491 Signed-off-by: Varsha Rao (cherry picked from commit db50dd29c3b9a7c2d6069093a56edc2c5bf0b5d7) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index a90116c6be17c..0d26d9be15d32 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -425,12 +425,14 @@ class TestNFS(MgrTestCase): ''' self._test_create_cluster() info_output = json.loads(self._nfs_cmd('cluster', 'info', self.cluster_id)) + info_ip = info_output[self.cluster_id][0].pop("ip") 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 }]} + host_ip = self._sys_cmd(['hostname', '-I']).decode("utf-8").split() self.assertDictEqual(info_output, host_details) + self.assertTrue(any([ip in info_ip for ip in host_ip])) self._test_delete_cluster() def test_cluster_set_reset_user_config(self):