From e2176667a0a05302ba4bbf9b65de1d3309eaee51 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 8 Jan 2016 18:20:29 +0000 Subject: [PATCH] tasks/cephfs: move the journaltool smoke test into python land This is one of those things that had a convoluted .yaml file because it predated the ability to write explicit procedural python tests. Signed-off-by: John Spray --- .../fs/basic/tasks/cephfs_journal_tool.yaml | 22 --------- tasks/cephfs/test_journal_repair.py | 49 ++++++++++++++++++- 2 files changed, 48 insertions(+), 23 deletions(-) delete mode 100644 suites/fs/basic/tasks/cephfs_journal_tool.yaml diff --git a/suites/fs/basic/tasks/cephfs_journal_tool.yaml b/suites/fs/basic/tasks/cephfs_journal_tool.yaml deleted file mode 100644 index 622fe8f41cb..00000000000 --- a/suites/fs/basic/tasks/cephfs_journal_tool.yaml +++ /dev/null @@ -1,22 +0,0 @@ - -tasks: -- ceph-fuse: -- workunit: - clients: - all: [fs/misc/trivial_sync.sh] -- ceph-fuse: - client.0: - mounted: false -- ceph.stop: [mds.*] -- workunit: - clients: - client.0: [suites/cephfs_journal_tool_smoke.sh] -- ceph.restart: - daemons: [mds.*] - wait-for-healthy: true -- ceph-fuse: - client.0: - mounted: true -- workunit: - clients: - all: [fs/misc/trivial_sync.sh] diff --git a/tasks/cephfs/test_journal_repair.py b/tasks/cephfs/test_journal_repair.py index a07bb0befe8..f3bf16905c1 100644 --- a/tasks/cephfs/test_journal_repair.py +++ b/tasks/cephfs/test_journal_repair.py @@ -11,6 +11,7 @@ import time from teuthology.orchestra.run import CommandFailedError from tasks.cephfs.filesystem import ObjectNotFound, ROOT_INO from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.workunit import task as workunit log = logging.getLogger(__name__) @@ -242,8 +243,12 @@ class TestJournalRepair(CephFSTestCase): self.wait_until_true(is_marked_damaged, 60) + def get_state(): + info = self.mds_cluster.get_mds_info(damaged_id) + return info['state'] if info is not None else None + self.wait_until_equal( - lambda: self.mds_cluster.get_mds_info(mds_id)['state'], + get_state, "up:standby", timeout=60) @@ -387,3 +392,45 @@ class TestJournalRepair(CephFSTestCase): "len": initial_range_len - 101}]}}, "result": 0}} ) + + @long_running # Hack: "long running" because .sh doesn't work outside teuth + def test_journal_smoke(self): + workunit(self.ctx, { + 'clients': { + "client.{0}".format(self.mount_a.client_id): [ + "fs/misc/trivial_sync.sh"], + }, + "timeout": "1h" + }) + + for mount in self.mounts: + mount.umount_wait() + + self.fs.mds_stop() + self.fs.mds_fail() + + # journal tool smoke + workunit(self.ctx, { + 'clients': { + "client.{0}".format(self.mount_a.client_id): [ + "suites/cephfs_journal_tool_smoke.sh"], + }, + "timeout": "1h" + }) + + + + self.fs.mds_restart() + self.fs.wait_for_daemons() + + self.mount_a.mount() + + # trivial sync moutn a + workunit(self.ctx, { + 'clients': { + "client.{0}".format(self.mount_a.client_id): [ + "fs/misc/trivial_sync.sh"], + }, + "timeout": "1h" + }) + -- 2.39.5