From ae3faac004e64fa2e3bd4a3ff0d823db4da2685c Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 15 Jul 2024 14:08:17 +0800 Subject: [PATCH] qa/cephfs: fix TestRenameCommand and unmount the clinet before failing fs We should else bring and wait for MDS to be up since it is needed for unmounting of CephFS in CephFSTestCase.tearDown() to be successful, or just unmount the mountpoints before failing the filesystem. Since the mountpoint won't be used in later tests so we just unmount it. Fixes: https://tracker.ceph.com/issues/66946 Signed-off-by: Xiubo Li --- qa/tasks/cephfs/test_admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index 7bfb1c5faa2..ff9962e7310 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -994,6 +994,9 @@ class TestRenameCommand(TestAdminCommands): """ That renaming a file system without '--yes-i-really-mean-it' flag fails. """ + # Failing the file system breaks this mount + self.mount_a.umount_wait(require_clean=True) + self.run_ceph_cmd(f'fs fail {self.fs.name}') self.run_ceph_cmd(f'fs set {self.fs.name} refuse_client_session true') sleep(5) @@ -1016,6 +1019,9 @@ class TestRenameCommand(TestAdminCommands): """ That renaming a non-existent file system fails. """ + # Failing the file system breaks this mount + self.mount_a.umount_wait(require_clean=True) + self.run_ceph_cmd(f'fs fail {self.fs.name}') self.run_ceph_cmd(f'fs set {self.fs.name} refuse_client_session true') sleep(5) @@ -1036,6 +1042,9 @@ class TestRenameCommand(TestAdminCommands): """ self.fs2 = self.mds_cluster.newfs(name='cephfs2', create=True) + # let's unmount the client before failing the FS + self.mount_a.umount_wait(require_clean=True) + self.run_ceph_cmd(f'fs fail {self.fs.name}') self.run_ceph_cmd(f'fs set {self.fs.name} refuse_client_session true') sleep(5) @@ -1059,6 +1068,9 @@ class TestRenameCommand(TestAdminCommands): orig_fs_name = self.fs.name new_fs_name = 'new_cephfs' + # let's unmount the client before failing the FS + self.mount_a.umount_wait(require_clean=True) + self.run_ceph_cmd(f'fs mirror enable {orig_fs_name}') self.run_ceph_cmd(f'fs fail {self.fs.name}') self.run_ceph_cmd(f'fs set {self.fs.name} refuse_client_session true') -- 2.39.5