]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: Add test for 'fs status' in standby-replay mds setup
authorKotresh HR <khiremat@redhat.com>
Tue, 10 Sep 2024 08:25:12 +0000 (13:55 +0530)
committerKotresh HR <khiremat@redhat.com>
Tue, 8 Oct 2024 09:15:39 +0000 (14:45 +0530)
Fixes: https://tracker.ceph.com/issues/67978
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 8f96936006912655602320aedbec506c230557fc)

qa/tasks/cephfs/test_admin.py

index 34dc59ab2a230754a07fbd2ebd665859fa1d2d5d..f50c0a341d2aa822e4f79f9c6126539f7b326f83 100644 (file)
@@ -220,6 +220,8 @@ class TestFsStatus(TestAdminCommands):
     Test "ceph fs status subcommand.
     """
 
+    MDSS_REQUIRED = 3
+
     def test_fs_status(self):
         """
         That `ceph fs status` command functions.
@@ -234,6 +236,31 @@ class TestFsStatus(TestAdminCommands):
         mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json"))["mdsmap"]
         self.assertEqual(mdsmap[0]["state"], "active")
 
+    def test_fs_status_standby_replay(self):
+        """
+        That `ceph fs status` command functions.
+        """
+
+        self.fs.set_allow_standby_replay(True)
+
+        s = self.get_ceph_cmd_stdout("fs", "status")
+        self.assertTrue("active" in s)
+        self.assertTrue("standby-replay" in s)
+        self.assertTrue("0-s" in s)
+        self.assertTrue("standby" in s)
+
+        mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json-pretty"))["mdsmap"]
+        self.assertEqual(mdsmap[0]["state"], "active")
+        self.assertEqual(mdsmap[1]["state"], "standby-replay")
+        self.assertEqual(mdsmap[1]["rank"], "0-s")
+        self.assertEqual(mdsmap[2]["state"], "standby")
+
+        mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json"))["mdsmap"]
+        self.assertEqual(mdsmap[0]["state"], "active")
+        self.assertEqual(mdsmap[1]["state"], "standby-replay")
+        self.assertEqual(mdsmap[1]["rank"], "0-s")
+        self.assertEqual(mdsmap[2]["state"], "standby")
+
 
 class TestAddDataPool(TestAdminCommands):
     """