]> git.apps.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>
Thu, 28 Jan 2016 22:08:46 +0000 (17:08 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit e9570fcf4be9cd5c06937769d074fa52ffb32e4b)

src/test/librbd/test_librbd.cc

index 2e032e662218433de4eb71fa3aae6fdf90bc1b20..59981ea0c2fc3690767debed0ecdc83f4ddf59ba 100644 (file)
@@ -2502,8 +2502,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));