]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/cls_rbd: removed mirror peer pool test cases 31485/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 16 Oct 2019 00:42:29 +0000 (20:42 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 8 Nov 2019 13:15:14 +0000 (14:15 +0100)
The mirror peer pool id has never been used and has been dropped
from the Octopus release. This will fix the breakage in the test
cases where the pool id was tested.

Fixes: https://tracker.ceph.com/issues/42333
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f0492ebd677cb8cb4656fc8f1dc871db1a6e7753)

Conflicts:
src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_client.h
- I could not find the reason for the conflicts; it seems that git
  got confused. Cherry-picked the changes in these two files manually.

src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_client.h
src/test/cls_rbd/test_cls_rbd.cc

index 0820b30b5cdd316c192f0499e57e8be3e21812a7..e647437799577ebd55556a0cba0b84eca1ca266f 100644 (file)
@@ -1680,8 +1680,8 @@ namespace librbd {
 
     int mirror_peer_add(librados::IoCtx *ioctx, const std::string &uuid,
                         const std::string &cluster_name,
-                        const std::string &client_name, int64_t pool_id) {
-      cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name, pool_id);
+                        const std::string &client_name) {
+      cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name, -1);
       bufferlist in_bl;
       encode(peer, in_bl);
 
index 4e4a0c9b80e09578f73aa3fe40a46efab4010ea7..776410146e067c3587b9cbd2e31c1d95768ba235 100644 (file)
@@ -349,8 +349,7 @@ namespace librbd {
                          std::vector<cls::rbd::MirrorPeer> *peers);
     int mirror_peer_add(librados::IoCtx *ioctx, const std::string &uuid,
                         const std::string &cluster_name,
-                        const std::string &client_name,
-                        int64_t pool_id = -1);
+                        const std::string &client_name);
     int mirror_peer_remove(librados::IoCtx *ioctx,
                            const std::string &uuid);
     int mirror_peer_set_client(librados::IoCtx *ioctx,
index 8c9e642c3c4da6b92d9dff9bc36d248e477f2ea3..519cbf7bf0677d5f844ab2840c2a26c2fa5b8dc0 100644 (file)
@@ -1508,21 +1508,17 @@ TEST_F(TestClsRbd, mirror) {
   ASSERT_EQ(0, mirror_peer_add(&ioctx, "uuid2", "cluster2", "admin"));
   ASSERT_EQ(-ESTALE, mirror_peer_add(&ioctx, "uuid2", "cluster3", "foo"));
   ASSERT_EQ(-EEXIST, mirror_peer_add(&ioctx, "uuid3", "cluster1", "foo"));
-  ASSERT_EQ(0, mirror_peer_add(&ioctx, "uuid3", "cluster3", "admin", 123));
+  ASSERT_EQ(0, mirror_peer_add(&ioctx, "uuid3", "cluster3", "admin"));
   ASSERT_EQ(-EEXIST, mirror_peer_add(&ioctx, "uuid4", "cluster3", "admin"));
-  ASSERT_EQ(-EEXIST, mirror_peer_add(&ioctx, "uuid4", "cluster3", "admin", 123));
-  ASSERT_EQ(0, mirror_peer_add(&ioctx, "uuid4", "cluster3", "admin", 234));
 
   ASSERT_EQ(0, mirror_peer_list(&ioctx, &peers));
   std::vector<cls::rbd::MirrorPeer> expected_peers = {
     {"uuid1", "cluster1", "client", -1},
     {"uuid2", "cluster2", "admin", -1},
-    {"uuid3", "cluster3", "admin", 123},
-    {"uuid4", "cluster3", "admin", 234}};
+    {"uuid3", "cluster3", "admin", -1}};
   ASSERT_EQ(expected_peers, peers);
 
   ASSERT_EQ(0, mirror_peer_remove(&ioctx, "uuid5"));
-  ASSERT_EQ(0, mirror_peer_remove(&ioctx, "uuid4"));
   ASSERT_EQ(0, mirror_peer_remove(&ioctx, "uuid2"));
 
   ASSERT_EQ(-ENOENT, mirror_peer_set_client(&ioctx, "uuid4", "new client"));
@@ -1534,7 +1530,7 @@ TEST_F(TestClsRbd, mirror) {
   ASSERT_EQ(0, mirror_peer_list(&ioctx, &peers));
   expected_peers = {
     {"uuid1", "cluster1", "new client", -1},
-    {"uuid3", "new cluster", "admin", 123}};
+    {"uuid3", "new cluster", "admin", -1}};
   ASSERT_EQ(expected_peers, peers);
   ASSERT_EQ(-EBUSY, mirror_mode_set(&ioctx, cls::rbd::MIRROR_MODE_DISABLED));