From 8921c8e1dc256bb6f4b8115e417e11a5bef33903 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 23 Apr 2020 03:21:09 -0400 Subject: [PATCH] qa/cephfs: switch to mount_wait() to avoid possible umounted assert For the fuse mount, it sometime will need to wait to a moment to let the client get ready. Signed-off-by: Xiubo Li --- qa/tasks/cephfs/test_quota.py | 2 +- qa/tasks/cephfs/test_sessionmap.py | 2 +- qa/tasks/cephfs/test_volume_client.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qa/tasks/cephfs/test_quota.py b/qa/tasks/cephfs/test_quota.py index dcfda5e216e..cad5baca7a6 100644 --- a/qa/tasks/cephfs/test_quota.py +++ b/qa/tasks/cephfs/test_quota.py @@ -47,7 +47,7 @@ class TestQuota(CephFSTestCase): self.mount_a.setfattr("./subdir", "ceph.quota.max_bytes", "%s" % size_before) - self.mount_b.mount(mount_path="/subdir") + self.mount_b.mount_wait(mount_path="/subdir") self.assertDictEqual( self.mount_b.df(), diff --git a/qa/tasks/cephfs/test_sessionmap.py b/qa/tasks/cephfs/test_sessionmap.py index bdcde71d095..4446a15c17d 100644 --- a/qa/tasks/cephfs/test_sessionmap.py +++ b/qa/tasks/cephfs/test_sessionmap.py @@ -186,7 +186,7 @@ class TestSessionMap(CephFSTestCase): # Try to mount the client, see that it fails with self.assert_cluster_log("client session with non-allowable root '/baz' denied"): with self.assertRaises(CommandFailedError): - self.mount_b.mount(mount_path="/foo/bar") + self.mount_b.mount_wait(mount_path="/foo/bar") def test_session_evict_blacklisted(self): """ diff --git a/qa/tasks/cephfs/test_volume_client.py b/qa/tasks/cephfs/test_volume_client.py index e02ba0ee76e..fafe7498d47 100644 --- a/qa/tasks/cephfs/test_volume_client.py +++ b/qa/tasks/cephfs/test_volume_client.py @@ -201,7 +201,7 @@ vc.disconnect() # the volume. self._configure_guest_auth(self.mount_b, self.mounts[2], guest_entity, mount_path, namespace_prefix) - self.mounts[2].mount(mount_path=mount_path) + self.mounts[2].mount_wait(mount_path=mount_path) # The kernel client doesn't have the quota-based df behaviour, # or quotas at all, so only exercise the client behaviour when @@ -450,7 +450,7 @@ vc.disconnect() # Mount the volume. guest_mounts[i].mountpoint_dir_name = 'mnt.{id}.{suffix}'.format( id=guest_entity, suffix=str(i)) - guest_mounts[i].mount(mount_path=mount_paths[i]) + guest_mounts[i].mount_wait(mount_path=mount_paths[i]) guest_mounts[i].write_n_mb("data.bin", 1) @@ -582,7 +582,7 @@ vc.disconnect() mount_path, readonly=False) # Mount the volume, and write to it. - guest_mount.mount(mount_path=mount_path) + guest_mount.mount_wait(mount_path=mount_path) guest_mount.write_n_mb("data.bin", 1) # Change the guest auth ID's authorization to read-only mount access. @@ -601,7 +601,7 @@ vc.disconnect() # immediate. The guest sees the change only after a remount of # the volume. guest_mount.umount_wait() - guest_mount.mount(mount_path=mount_path) + guest_mount.mount_wait(mount_path=mount_path) # Read existing content of the volume. self.assertListEqual(guest_mount.ls(guest_mount.mountpoint), ["data.bin"]) @@ -1062,7 +1062,7 @@ vc.disconnect() # Mount the volume in the guest using the auth ID to assert that the # auth caps are valid - guest_mount.mount(mount_path=mount_path) + guest_mount.mount_wait(mount_path=mount_path) def test_volume_without_namespace_isolation(self): """ -- 2.47.3