]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: fix gmock warnings in bootstrap request unit tests 12425/head
authorMykola Golub <mgolub@mirantis.com>
Tue, 6 Dec 2016 21:19:54 +0000 (23:19 +0200)
committerNathan Cutler <ncutler@suse.com>
Sun, 29 Jan 2017 20:37:55 +0000 (21:37 +0100)
Fixes: http://tracker.ceph.com/issues/18156
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 376026d7b24c77a59ef95d0f66686494caf0e9d0)

src/test/rbd_mirror/image_replayer/test_mock_BootstrapRequest.cc

index 471166b70fb22c822476c7ebc5308a39c54e1f2a..56bb21f2df279c74673a1c5351bd91d44fc8e5a6 100644 (file)
@@ -375,6 +375,13 @@ public:
     EXPECT_CALL(mock_journal, get_tag_data()).WillOnce(Return(tag_data));
   }
 
+  void expect_is_resync_requested(librbd::MockJournal &mock_journal,
+                                  bool do_resync, int r) {
+    EXPECT_CALL(mock_journal, is_resync_requested(_))
+      .WillOnce(DoAll(SetArgPointee<0>(do_resync),
+                      Return(r)));
+  }
+
   bufferlist encode_tag_data(const librbd::journal::TagData &tag_data) {
     bufferlist bl;
     ::encode(tag_data, bl);
@@ -512,6 +519,7 @@ TEST_F(TestMockImageReplayerBootstrapRequest, RemoteDemotePromote) {
   MockOpenLocalImageRequest mock_open_local_image_request;
   expect_open_local_image(mock_open_local_image_request, m_local_io_ctx,
                           mock_local_image_ctx.id, mock_local_image_ctx, 0);
+  expect_is_resync_requested(mock_journal, false, 0);
 
   // remote demotion / promotion event
   Tags tags = {
@@ -589,6 +597,7 @@ TEST_F(TestMockImageReplayerBootstrapRequest, MultipleRemoteDemotePromotes) {
   MockOpenLocalImageRequest mock_open_local_image_request;
   expect_open_local_image(mock_open_local_image_request, m_local_io_ctx,
                           mock_local_image_ctx.id, mock_local_image_ctx, 0);
+  expect_is_resync_requested(mock_journal, false, 0);
 
   // remote demotion / promotion event
   Tags tags = {
@@ -676,6 +685,7 @@ TEST_F(TestMockImageReplayerBootstrapRequest, LocalDemoteRemotePromote) {
   MockOpenLocalImageRequest mock_open_local_image_request;
   expect_open_local_image(mock_open_local_image_request, m_local_io_ctx,
                           mock_local_image_ctx.id, mock_local_image_ctx, 0);
+  expect_is_resync_requested(mock_journal, false, 0);
 
   // remote demotion / promotion event
   Tags tags = {
@@ -751,6 +761,7 @@ TEST_F(TestMockImageReplayerBootstrapRequest, SplitBrainForcePromote) {
   MockOpenLocalImageRequest mock_open_local_image_request;
   expect_open_local_image(mock_open_local_image_request, m_local_io_ctx,
                           mock_local_image_ctx.id, mock_local_image_ctx, 0);
+  expect_is_resync_requested(mock_journal, false, 0);
 
   // remote demotion / promotion event
   Tags tags = {