diff options
author | Jason Dillaman <dillaman@redhat.com> | 2020-06-18 18:56:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 18:56:31 +0200 |
commit | 187367ff17de1e63f4331f41be89a7a642ce4fc4 (patch) | |
tree | 49c558ef8670165083f4f7863b2576ce011fee1d /src/test/librbd/operation | |
parent | Merge PR #35649 into master (diff) | |
parent | test/librbd: make TestLibRBD.QuiesceWatchError pass (diff) | |
download | ceph-187367ff17de1e63f4331f41be89a7a642ce4fc4.tar.xz ceph-187367ff17de1e63f4331f41be89a7a642ce4fc4.zip |
Merge pull request #35329 from trociny/wip-quiesce_complete
librbd: quiesce/unquiesce API improvements
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/test/librbd/operation')
-rw-r--r-- | src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc | 12 | ||||
-rw-r--r-- | src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc index f43b39f3601..cf56f9e2980 100644 --- a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc @@ -63,10 +63,9 @@ public: typedef mirror::snapshot::SetImageStateRequest<MockImageCtx> MockSetImageStateRequest; void expect_notify_quiesce(MockImageCtx &mock_image_ctx, int r) { - EXPECT_CALL(*mock_image_ctx.image_watcher, notify_quiesce(_, _)) - .WillOnce(DoAll(WithArg<1>(CompleteContext( - r, mock_image_ctx.image_ctx->op_work_queue)), - Return(0))); + EXPECT_CALL(*mock_image_ctx.image_watcher, notify_quiesce(_, _, _)) + .WillOnce(WithArg<2>(CompleteContext( + r, mock_image_ctx.image_ctx->op_work_queue))); } void expect_block_writes(MockImageCtx &mock_image_ctx) { @@ -173,7 +172,7 @@ TEST_F(TestMockOperationSnapshotCreateRequest, Success) { expect_op_work_queue(mock_image_ctx); ::testing::InSequence seq; - expect_notify_quiesce(mock_image_ctx, 0); + expect_notify_quiesce(mock_image_ctx, -EINVAL); expect_block_writes(mock_image_ctx); expect_allocate_snap_id(mock_image_ctx, 0); expect_snap_create(mock_image_ctx, 0); @@ -188,7 +187,7 @@ TEST_F(TestMockOperationSnapshotCreateRequest, Success) { librbd::NoOpProgressContext prog_ctx; MockSnapshotCreateRequest *req = new MockSnapshotCreateRequest( mock_image_ctx, &cond_ctx, cls::rbd::UserSnapshotNamespace(), - "snap1", 0, 0, prog_ctx); + "snap1", 0, SNAP_CREATE_FLAG_IGNORE_NOTIFY_QUIESCE_ERROR, prog_ctx); { std::shared_lock owner_locker{mock_image_ctx.owner_lock}; req->send(); @@ -206,6 +205,7 @@ TEST_F(TestMockOperationSnapshotCreateRequest, NotifyQuiesceError) { ::testing::InSequence seq; expect_notify_quiesce(mock_image_ctx, -EINVAL); + expect_notify_unquiesce(mock_image_ctx, 0); C_SaferCond cond_ctx; librbd::NoOpProgressContext prog_ctx; diff --git a/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc b/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc index 208998b5eac..74c0108300d 100644 --- a/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc @@ -446,8 +446,9 @@ TEST_F(TestMockOperationSnapshotRemoveRequest, TrashCloneParent) { librbd::ImageCtx *ictx; ASSERT_EQ(0, open_image(m_image_name, &ictx)); + NoOpProgressContext prog_ctx; ASSERT_EQ(0, ictx->operations->snap_create( - {cls::rbd::TrashSnapshotNamespace{}}, "snap1")); + {cls::rbd::TrashSnapshotNamespace{}}, "snap1", 0, prog_ctx)); ASSERT_EQ(0, ictx->state->refresh_if_required()); MockImageCtx mock_image_ctx(*ictx); |