]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/nfs: Check if host ip is in cluster info output 39004/head
authorVarsha Rao <varao@redhat.com>
Wed, 9 Dec 2020 16:52:50 +0000 (16:52 +0000)
committerVicente Cheng <freeze.bilsted@gmail.com>
Thu, 21 Jan 2021 16:15:23 +0000 (16:15 +0000)
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 <varao@redhat.com>
(cherry picked from commit db50dd29c3b9a7c2d6069093a56edc2c5bf0b5d7)

qa/tasks/cephfs/test_nfs.py

index a90116c6be17ce79eef5b7bab4b915d8153d2e85..0d26d9be15d324378937e887789c31dfcc3999fb 100644 (file)
@@ -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):