]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: Validate mon_host and fsid in daemon status wip-khiremat-mirror-status-67335
authorKotresh HR <khiremat@redhat.com>
Tue, 17 Feb 2026 19:29:50 +0000 (00:59 +0530)
committerKotresh HR <khiremat@redhat.com>
Tue, 17 Feb 2026 19:34:01 +0000 (01:04 +0530)
Fixes: https://tracker.ceph.com/issues/73455
Signed-off-by: Kotresh HR <khiremat@redhat.com>
qa/tasks/cephfs/test_mirroring.py

index 73597a1d6742a50a48c365607e4934469f843e43..ef571e69f78fd1a80ccc012136dc0a573713359c 100644 (file)
@@ -1,5 +1,6 @@
 import os
 import json
+import base64
 import errno
 import logging
 import random
@@ -876,7 +877,17 @@ class TestMirroring(CephFSTestCase):
 
     def test_cephfs_mirror_service_daemon_status(self):
         self.enable_mirroring(self.primary_fs_name, self.primary_fs_id)
-        self.peer_add(self.primary_fs_name, self.primary_fs_id, "client.mirror_remote@ceph", self.secondary_fs_name)
+
+        # create a bootstrap token for the peer
+        bootstrap_token = self.bootstrap_peer(self.secondary_fs_name, "client.mirror_peer_bootstrap", "site-remote")
+        # Decode the token to extract the FSID
+        token_str = base64.b64decode(bootstrap_token)
+        token_dct = json.loads(token_str.decode('utf-8'))
+        expected_remote_fsid = token_dct['fsid']
+        expected_remote_mon_host = token_dct['mon_host']
+
+        # import the peer via bootstrap token
+        self.import_peer(self.primary_fs_name, bootstrap_token)
 
         time.sleep(30)
         status = self.get_mirror_daemon_status()
@@ -890,6 +901,11 @@ class TestMirroring(CephFSTestCase):
         self.assertEqual(peer['stats']['failure_count'], 0)
         self.assertEqual(peer['stats']['recovery_count'], 0)
 
+        remote = peer['remote']
+        self.assertEqual(remote['fs_name'], self.secondary_fs_name)
+        self.assertEqual(remote['fsid'], expected_remote_fsid)
+        self.assertEqual(remote['mon_host'], expected_remote_mon_host)
+
         # add a non-existent directory for synchronization -- check if its reported
         # in daemon stats
         self.add_directory(self.primary_fs_name, self.primary_fs_id, '/d0')