From f253e3c3117aad183b05b863474c6d92fb923ed4 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 13 Jul 2018 07:39:12 -0400 Subject: [PATCH] test: validate empty json output during recursive scrub Signed-off-by: Venky Shankar Fixes: http://tracker.ceph.com/issues/23958 --- qa/tasks/cephfs/test_forward_scrub.py | 9 ++++++--- qa/tasks/cephfs/test_scrub.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/test_forward_scrub.py b/qa/tasks/cephfs/test_forward_scrub.py index ac912dd0b2968..1f80366af0cf9 100644 --- a/qa/tasks/cephfs/test_forward_scrub.py +++ b/qa/tasks/cephfs/test_forward_scrub.py @@ -232,7 +232,8 @@ class TestForwardScrub(CephFSTestCase): self.mount_a.umount_wait() with self.assert_cluster_log("inode table repaired", invert_match=True): - self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + self.assertNotEqual(out_json, None) self.mds_cluster.mds_stop() self.mds_cluster.mds_fail() @@ -254,7 +255,8 @@ class TestForwardScrub(CephFSTestCase): self.fs.wait_for_daemons() with self.assert_cluster_log("inode table repaired"): - self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + self.assertNotEqual(out_json, None) self.mds_cluster.mds_stop() table_text = self.fs.table_tool(["0", "show", "inode"]) @@ -284,7 +286,8 @@ class TestForwardScrub(CephFSTestCase): "oh i'm sorry did i overwrite your xattr?") with self.assert_cluster_log("bad backtrace on inode"): - self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"]) + self.assertNotEqual(out_json, None) self.fs.mds_asok(["flush", "journal"]) backtrace = self.fs.read_backtrace(file_ino) self.assertEqual(['alpha', 'parent_a'], diff --git a/qa/tasks/cephfs/test_scrub.py b/qa/tasks/cephfs/test_scrub.py index 12ce1668ed1bf..9469dfce6e493 100644 --- a/qa/tasks/cephfs/test_scrub.py +++ b/qa/tasks/cephfs/test_scrub.py @@ -103,7 +103,8 @@ class DupInodeWorkload(Workload): self._filesystem.wait_for_daemons() def validate(self): - self._filesystem.mds_asok(["scrub_path", "/", "recursive", "repair"]) + out_json = self._filesystem.mds_asok(["scrub_path", "/", "recursive", "repair"]) + self.assertNotEqual(out_json, None) self.assertTrue(self._filesystem.are_daemons_healthy()) return self._errors @@ -128,7 +129,8 @@ class TestScrub(CephFSTestCase): # Apply any data damage the workload wants workload.damage() - self.fs.mds_asok(["scrub_path", "/", "recursive", "repair"]) + out_json = self.fs.mds_asok(["scrub_path", "/", "recursive", "repair"]) + self.assertNotEqual(out_json, None) # See that the files are present and correct errors = workload.validate() -- 2.39.5