]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: simulate writeback flush during snap create
authorJason Dillaman <dillaman@redhat.com>
Thu, 28 Jan 2016 17:40:18 +0000 (12:40 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 29 Jan 2016 01:04:33 +0000 (20:04 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_librbd.cc

index e8b21d6ee5c1af34a2d5ea49d073f0833428c961..7e05ab23d35a32f62f0009f50d287139fd8e5995 100644 (file)
@@ -3039,8 +3039,12 @@ TEST_F(TestLibRBD, SnapCreateViaLockOwner)
   librbd::Image image1;
   ASSERT_EQ(0, rbd.open(ioctx, image1, name.c_str(), NULL));
 
+  // switch to writeback cache
+  ASSERT_EQ(0, image1.flush());
+
   bufferlist bl;
-  ASSERT_EQ(0, image1.write(0, 0, bl));
+  bl.append(std::string(4096, '1'));
+  ASSERT_EQ(bl.length(), image1.write(0, bl.length(), bl));
 
   bool lock_owner;
   ASSERT_EQ(0, image1.is_exclusive_lock_owner(&lock_owner));