]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: verify fast diff support in rebuild object map 4186/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Apr 2015 16:44:18 +0000 (12:44 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 14 Apr 2015 17:11:32 +0000 (13:11 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_librbd.cc

index 134a08bde806c93f421c1979a32064e345edcf2f..38c294c1f5f8a9f6c2d95812b358197f8d899e00 100644 (file)
@@ -2939,6 +2939,9 @@ TEST_F(TestLibRBD, RebuildObjectMap)
 
     ASSERT_EQ(bl.length(), image.write(0, bl.length(), bl));
 
+    ASSERT_EQ(0, image.snap_create("snap1"));
+    ASSERT_EQ(bl.length(), image.write(1<<order, bl.length(), bl));
+
     librbd::image_info_t info;
     ASSERT_EQ(0, image.stat(info, sizeof(info)));
 
@@ -2969,6 +2972,10 @@ TEST_F(TestLibRBD, RebuildObjectMap)
   ASSERT_EQ(bl.length(), image2.read(0, bl.length(), read_bl));
   ASSERT_TRUE(bl.contents_equal(read_bl));
 
+  read_bl.clear();
+  ASSERT_EQ(bl.length(), image2.read(1<<order, bl.length(), read_bl));
+  ASSERT_TRUE(bl.contents_equal(read_bl));
+
   ASSERT_PASSED(validate_object_map, image1);
   ASSERT_PASSED(validate_object_map, image2);
 }