From 3fccec41f682fea72588d4ce35e1d5947a90a9b2 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 16 Nov 2020 16:01:28 -0500 Subject: [PATCH] rgw_file: fix librgw_file_gp unit test and driver 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 --- src/test/librgw_file_gp.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/librgw_file_gp.cc b/src/test/librgw_file_gp.cc index b1bd931f170..c274a82706f 100644 --- a/src/test/librgw_file_gp.cc +++ b/src/test/librgw_file_gp.cc @@ -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 -- 2.39.5