]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rados-api/io.cc: add RemoveTestPP
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 11 Aug 2011 20:01:24 +0000 (13:01 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 11 Aug 2011 20:01:24 +0000 (13:01 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/test/rados-api/io.cc

index 8c5798a770fc6ebce8182b9a4411f472a1f7c507..8057ada21b54a74ba0b4af1a5bba7e40b8880e8a 100644 (file)
@@ -260,6 +260,24 @@ TEST(LibRadosIo, RemoveTest) {
   ASSERT_EQ(0, destroy_one_pool(pool_name, &cluster));
 }
 
+TEST(LibRadosIo, RemoveTestPP) {
+  char buf[128];
+  Rados cluster;
+  IoCtx ioctx;
+  std::string pool_name = get_temp_pool_name();
+  ASSERT_EQ("", create_one_pool_pp(pool_name, cluster));
+  cluster.ioctx_create(pool_name.c_str(), ioctx);
+  memset(buf, 0xaa, sizeof(buf));
+  bufferlist bl1;
+  bl1.append(buf, sizeof(buf));
+  ASSERT_EQ((int)sizeof(buf), ioctx.append("foo", bl1, sizeof(buf)));
+  ASSERT_EQ(0, ioctx.remove("foo"));
+  bufferlist bl2;
+  ASSERT_EQ(-ENOENT, ioctx.read("foo", bl2, sizeof(buf), 0));
+  ioctx.close();
+  ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
+}
+
 TEST(LibRadosIo, XattrsRoundTrip) {
   char buf[128];
   char attr1[] = "attr1";