]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: add Mock Image cache for compare_and_write
authorwangzhengyong <wangzhengyong@cmss.chinamobile.com>
Mon, 12 Jun 2017 13:24:38 +0000 (21:24 +0800)
committerJason Dillaman <dillaman@redhat.com>
Wed, 26 Jul 2017 12:00:06 +0000 (08:00 -0400)
Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
src/test/librbd/mock/cache/MockImageCache.h

index 8c5624c8659ffe0d445ab88d88fdbc56d34d846b..473f7c8a8b8495830a48aa897c82fd5875f9e8c4 100644 (file)
@@ -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