From 8334bea5a64bb4b863e3ff1a6b46807bf03f3270 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 18 Aug 2020 05:32:38 -0400 Subject: [PATCH] test: optionally create a backup filesystem on startup Also filter out client-id's starting with "mirror" when cleaning leftover auth-ids since teuthology would be configured to create client.mirror and client.mirror_remote clients before executing mirroring tests. Signed-off-by: Venky Shankar --- qa/tasks/ceph_test_case.py | 1 + qa/tasks/cephfs/cephfs_test_case.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/qa/tasks/ceph_test_case.py b/qa/tasks/ceph_test_case.py index 0958caf2fa4..23cf4839f63 100644 --- a/qa/tasks/ceph_test_case.py +++ b/qa/tasks/ceph_test_case.py @@ -20,6 +20,7 @@ class CephTestCase(unittest.TestCase): mounts = None fs = None recovery_fs = None + backup_fs = None ceph_cluster = None mds_cluster = None mgr_cluster = None diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index 3c5a23d3ce7..9d689456c9d 100644 --- a/qa/tasks/cephfs/cephfs_test_case.py +++ b/qa/tasks/cephfs/cephfs_test_case.py @@ -80,6 +80,10 @@ class CephFSTestCase(CephTestCase): # requires REQUIRE_FILESYSTEM = True REQUIRE_RECOVERY_FILESYSTEM = False + # create a backup filesystem if required. + # required REQUIRE_FILESYSTEM enabled + REQUIRE_BACKUP_FILESYSTEM = False + LOAD_SETTINGS = [] # type: ignore def _save_mount_details(self): @@ -127,6 +131,7 @@ class CephFSTestCase(CephTestCase): self.mds_cluster.delete_all_filesystems() self.mds_cluster.mds_restart() # to reset any run-time configs, etc. self.fs = None # is now invalid! + self.backup_fs = None self.recovery_fs = None # In case anything is in the OSD blocklist list, clear it out. This is to avoid @@ -146,7 +151,7 @@ class CephFSTestCase(CephTestCase): # test, delete them for entry in self.auth_list(): ent_type, ent_id = entry['entity'].split(".") - if ent_type == "client" and ent_id not in client_mount_ids and ent_id != "admin": + if ent_type == "client" and ent_id not in client_mount_ids and not (ent_id == "admin" or ent_id[:6] == 'mirror'): self.mds_cluster.mon_manager.raw_cluster_cmd("auth", "del", entry['entity']) if self.REQUIRE_FILESYSTEM: @@ -172,6 +177,15 @@ class CephFSTestCase(CephTestCase): for i in range(0, self.CLIENTS_REQUIRED): self.mounts[i].mount_wait() + if self.REQUIRE_BACKUP_FILESYSTEM: + if not self.REQUIRE_FILESYSTEM: + self.skipTest("backup filesystem requires a primary filesystem as well") + self.fs.mon_manager.raw_cluster_cmd('fs', 'flag', 'set', + 'enable_multiple', 'true', + '--yes-i-really-mean-it') + self.backup_fs = self.mds_cluster.newfs(name="backup_fs") + self.backup_fs.wait_for_daemons() + if self.REQUIRE_RECOVERY_FILESYSTEM: if not self.REQUIRE_FILESYSTEM: self.skipTest("Recovery filesystem requires a primary filesystem as well") -- 2.39.5