]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add test for objectstore 1941/head
authorHaomai Wang <haomaiwang@gmail.com>
Thu, 27 Feb 2014 02:49:10 +0000 (10:49 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Mon, 9 Jun 2014 11:30:52 +0000 (19:30 +0800)
Add remove then write object in a transaction.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/test/objectstore/store_test.cc

index 582327303ea0e10007ec50ee2ef3f2945e8f13a7..f26229fe0823c87555cfce46cd65dbbf0d28ac08 100644 (file)
@@ -135,6 +135,24 @@ TEST_P(StoreTest, SimpleObjectTest) {
     r = store->apply_transaction(t);
     ASSERT_EQ(r, 0);
   }
+  {
+    ObjectStore::Transaction t;
+    t.remove(cid, hoid);
+    t.touch(cid, hoid);
+    cerr << "Remove then create" << std::endl;
+    r = store->apply_transaction(t);
+    ASSERT_EQ(r, 0);
+  }
+  {
+    ObjectStore::Transaction t;
+    bufferlist bl;
+    bl.append("abcde");
+    t.remove(cid, hoid);
+    t.write(cid, hoid, 10, 5, bl);
+    cerr << "Remove then create" << std::endl;
+    r = store->apply_transaction(t);
+    ASSERT_EQ(r, 0);
+  }
   {
     ObjectStore::Transaction t;
     t.remove(cid, hoid);