From db50dd29c3b9a7c2d6069093a56edc2c5bf0b5d7 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Wed, 9 Dec 2020 16:52:50 +0000 Subject: [PATCH] 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 --- qa/tasks/cephfs/test_nfs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index dccb3637aa7c..a4ab199a2626 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -428,12 +428,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): -- 2.47.3