From: Venky Shankar Date: Thu, 22 Apr 2021 08:48:48 +0000 (-0400) Subject: test: add test to verify adding an active peer back to source X-Git-Tag: v17.1.0~1613^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=074f55006edb605b35e3c9c20cdc70c4fa8d96e9;p=ceph.git test: add test to verify adding an active peer back to source Fixes: http://tracker.ceph.com/issues/50447 Signed-off-by: Venky Shankar --- diff --git a/qa/tasks/cephfs/test_mirroring.py b/qa/tasks/cephfs/test_mirroring.py index ea41d071bc77..6ea3d5d30225 100644 --- a/qa/tasks/cephfs/test_mirroring.py +++ b/qa/tasks/cephfs/test_mirroring.py @@ -26,6 +26,7 @@ class TestMirroring(CephFSTestCase): self.primary_fs_name = self.fs.name self.primary_fs_id = self.fs.id self.secondary_fs_name = self.backup_fs.name + self.secondary_fs_id = self.backup_fs.id self.enable_mirroring_module() def tearDown(self): @@ -1149,3 +1150,19 @@ class TestMirroring(CephFSTestCase): self.verify_snapshot(repo_path, 'snap_b') self.disable_mirroring(self.primary_fs_name, self.primary_fs_id) + + def test_cephfs_mirror_peer_add_primary(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) + + # try adding the primary file system as a peer to secondary file + # system + try: + self.peer_add(self.secondary_fs_name, self.secondary_fs_id, "client.mirror_remote@ceph", self.primary_fs_name) + except CommandFailedError as ce: + if ce.exitstatus != errno.EINVAL: + raise RuntimeError('invalid errno when adding a primary file system') + else: + raise RuntimeError('adding peer should fail') + + self.disable_mirroring(self.primary_fs_name, self.primary_fs_id)