From: wangzhengyong Date: Mon, 12 Jun 2017 13:24:38 +0000 (+0800) Subject: test/librbd: add Mock Image cache for compare_and_write X-Git-Tag: v12.1.2~106^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad10d615e60fdd617a716233d140d8661ecb6ab1;p=ceph.git test/librbd: add Mock Image cache for compare_and_write Signed-off-by: Zhengyong Wang --- diff --git a/src/test/librbd/mock/cache/MockImageCache.h b/src/test/librbd/mock/cache/MockImageCache.h index 8c5624c8659f..473f7c8a8b84 100644 --- a/src/test/librbd/mock/cache/MockImageCache.h +++ b/src/test/librbd/mock/cache/MockImageCache.h @@ -36,6 +36,18 @@ struct MockImageCache { int fadvise_flags, Context *on_finish) { aio_writesame_mock(off, len, bl, fadvise_flags, on_finish); } + + MOCK_METHOD6(aio_compare_and_write_mock, void(const Extents &, + const ceph::bufferlist &, + const ceph::bufferlist &, + uint64_t *, int, Context *)); + + void aio_compare_and_write(Extents&& image_extents, ceph::bufferlist&& cmp_bl, + ceph::bufferlist&& bl, uint64_t *mismatch_offset, + int fadvise_flags, Context *on_finish) { + aio_compare_and_write_mock(image_extents, cmp_bl, bl, mismatch_offset, + fadvise_flags, on_finish); + } }; } // namespace cache