]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/nfs: Check if host ip is in cluster info output 38511/head
authorVarsha Rao <varao@redhat.com>
Wed, 9 Dec 2020 16:52:50 +0000 (16:52 +0000)
committerVarsha Rao <varao@redhat.com>
Wed, 9 Dec 2020 16:52:50 +0000 (16:52 +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>
qa/tasks/cephfs/test_nfs.py

index dccb3637aa7c3264112bee51f53d06f32e2cba4a..a4ab199a2626f86ebf088d30b46e7fecd01ef088 100644 (file)
@@ -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):