]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix librgw_file_gp unit test and driver
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 16 Nov 2020 21:01:28 +0000 (16:01 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 16 Dec 2020 15:41:27 +0000 (10:41 -0500)
Fixes missing commit after rgw_write(), as well as conditional
cleanup.

Reorder tests, and split out librgw_file_gp --delete to avoid an
issue w/sysobj cache (temporary).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/test/librgw_file_gp.cc

index b1bd931f1701d8a9c9ae2fdbb17a12e49154eeb8..c274a82706fc27f06cbbf2d19c02f6aa80463d93 100644 (file)
@@ -243,6 +243,9 @@ TEST(LibRGW, PUT_OBJECT) {
                        (void*) data.c_str(), RGW_WRITE_FLAG_NONE);
     ASSERT_EQ(ret, 0);
     ASSERT_EQ(nbytes, data.length());
+    /* commit write transaction */
+    ret = rgw_close(fs, object_fh, 0 /* flags */);
+    ASSERT_EQ(ret, 0);
   }
 }
 
@@ -371,6 +374,14 @@ TEST(LibRGW, DELETE_OBJECT) {
   }
 }
 
+TEST(LibRGW, DELETE_BUCKET) {
+  if (do_delete) {
+    int ret = rgw_unlink(fs, fs->root_fh, bucket_name.c_str(),
+                        RGW_UNLINK_FLAG_NONE);
+    ASSERT_EQ(ret, 0);
+  }
+}
+
 TEST(LibRGW, CLEANUP) {
   if (do_readv) {
     // release resources