From: Xiubo Li Date: Mon, 15 Jul 2024 06:08:17 +0000 (+0800) Subject: qa/cephfs: fix TestRenameCommand and unmount the clinet before failing fs X-Git-Tag: v20.0.0~1302^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F58583%2Fhead;p=ceph.git 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 --- diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index 7bfb1c5faa24..ff9962e73104 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')