Skip to content

Commit 8f96936

Browse files
committed
qa: Add test for 'fs status' in standby-replay mds setup
Fixes: https://tracker.ceph.com/issues/67978 Signed-off-by: Kotresh HR <khiremat@redhat.com>
1 parent 8cf6dbd commit 8f96936

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

qa/tasks/cephfs/test_admin.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ class TestFsStatus(TestAdminCommands):
324324
Test "ceph fs status subcommand.
325325
"""
326326

327+
MDSS_REQUIRED = 3
328+
327329
def test_fs_status(self):
328330
"""
329331
That `ceph fs status` command functions.
@@ -338,6 +340,31 @@ def test_fs_status(self):
338340
mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json"))["mdsmap"]
339341
self.assertEqual(mdsmap[0]["state"], "active")
340342

343+
def test_fs_status_standby_replay(self):
344+
"""
345+
That `ceph fs status` command functions.
346+
"""
347+
348+
self.fs.set_allow_standby_replay(True)
349+
350+
s = self.get_ceph_cmd_stdout("fs", "status")
351+
self.assertTrue("active" in s)
352+
self.assertTrue("standby-replay" in s)
353+
self.assertTrue("0-s" in s)
354+
self.assertTrue("standby" in s)
355+
356+
mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json-pretty"))["mdsmap"]
357+
self.assertEqual(mdsmap[0]["state"], "active")
358+
self.assertEqual(mdsmap[1]["state"], "standby-replay")
359+
self.assertEqual(mdsmap[1]["rank"], "0-s")
360+
self.assertEqual(mdsmap[2]["state"], "standby")
361+
362+
mdsmap = json.loads(self.get_ceph_cmd_stdout("fs", "status", "--format=json"))["mdsmap"]
363+
self.assertEqual(mdsmap[0]["state"], "active")
364+
self.assertEqual(mdsmap[1]["state"], "standby-replay")
365+
self.assertEqual(mdsmap[1]["rank"], "0-s")
366+
self.assertEqual(mdsmap[2]["state"], "standby")
367+
341368

342369
class TestAddDataPool(TestAdminCommands):
343370
"""

0 commit comments

Comments
 (0)