From: Jason Dillaman Date: Sat, 11 Nov 2017 02:45:13 +0000 (-0500) Subject: test/librados_test_stub: mocked remainder of IO ops used by librbd X-Git-Tag: v12.2.3~84^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1fe2fe8d899930feecf6deee01d594691cab3f90;p=ceph.git test/librados_test_stub: mocked remainder of IO ops used by librbd Signed-off-by: Jason Dillaman (cherry picked from commit c4e5613e4a74316ba9667654e887a835b240609a) --- diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index 03c6c326de5..d6fb2647433 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -55,6 +55,16 @@ public: return TestMemIoCtxImpl::aio_unwatch(handle, c); } + MOCK_METHOD1(assert_exists, int(const std::string &)); + int do_assert_exists(const std::string &oid) { + return TestMemIoCtxImpl::assert_exists(oid); + } + + MOCK_METHOD3(cmpext, int(const std::string&, uint64_t, bufferlist&)); + int do_cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) { + return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl); + } + MOCK_METHOD7(exec, int(const std::string& oid, TestClassHandler *handler, const char *cls, @@ -160,12 +170,30 @@ public: return TestMemIoCtxImpl::write_full(oid, bl, snapc); } + + MOCK_METHOD5(writesame, int(const std::string& oid, bufferlist& bl, + size_t len, uint64_t off, + const SnapContext &snapc)); + int do_writesame(const std::string& oid, bufferlist& bl, size_t len, + uint64_t off, const SnapContext &snapc) { + return TestMemIoCtxImpl::writesame(oid, bl, len, off, snapc); + } + + MOCK_METHOD4(zero, int(const std::string& oid, uint64_t offset, + uint64_t length, const SnapContext &snapc)); + int do_zero(const std::string& oid, uint64_t offset, + uint64_t length, const SnapContext &snapc) { + return TestMemIoCtxImpl::zero(oid, offset, length, snapc); + } + void default_to_parent() { using namespace ::testing; ON_CALL(*this, aio_notify(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_notify)); ON_CALL(*this, aio_watch(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_watch)); ON_CALL(*this, aio_unwatch(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_unwatch)); + ON_CALL(*this, assert_exists(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_exists)); + ON_CALL(*this, cmpext(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext)); ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec)); ON_CALL(*this, get_instance_id()).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_get_instance_id)); ON_CALL(*this, list_snaps(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_snaps)); @@ -181,6 +209,8 @@ public: ON_CALL(*this, truncate(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_truncate)); ON_CALL(*this, write(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write)); ON_CALL(*this, write_full(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write_full)); + ON_CALL(*this, writesame(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_writesame)); + ON_CALL(*this, zero(_,_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_zero)); } private: