]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tasks/cephfs: move the journaltool smoke test into python land
authorJohn Spray <john.spray@redhat.com>
Fri, 8 Jan 2016 18:20:29 +0000 (18:20 +0000)
committerJohn Spray <john.spray@redhat.com>
Fri, 11 Mar 2016 10:36:43 +0000 (10:36 +0000)
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 <john.spray@redhat.com>
suites/fs/basic/tasks/cephfs_journal_tool.yaml [deleted file]
tasks/cephfs/test_journal_repair.py

diff --git a/suites/fs/basic/tasks/cephfs_journal_tool.yaml b/suites/fs/basic/tasks/cephfs_journal_tool.yaml
deleted file mode 100644 (file)
index 622fe8f..0000000
+++ /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]
index a07bb0befe842d5dfd771fb15ed1c673426c5e1f..f3bf16905c15fdd7f0028e5c09441b489399f09b 100644 (file)
@@ -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"
+        })
+