]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "test/librados/io_cxx: fix ec overwrites cleanup in CrcZeroWrite"
authorNitzan Mordechai <nmordech@redhat.com>
Wed, 15 Jan 2025 14:58:15 +0000 (14:58 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 15 Jan 2025 14:58:15 +0000 (14:58 +0000)
This reverts commit ce2378108f8630ec6ea195d66ff89cb71497b767.
Wrong order cherry-picked
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
src/test/librados/io_cxx.cc
src/test/librados/testcase_cxx.cc
src/test/librados/testcase_cxx.h

index 8e26c24e8a698b67eeb9d39a74c8887f27b6a87f..eda2d0c3af6fd133ead0c715af3119d729eee53c 100644 (file)
@@ -846,7 +846,7 @@ TEST_F(LibRadosIoECPP, RmXattrPP) {
 
 TEST_F(LibRadosIoECPP, CrcZeroWrite) {
   SKIP_IF_CRIMSON();
-  set_allow_ec_overwrites();
+  set_allow_ec_overwrites(pool_name, true);
   char buf[128];
   memset(buf, 0xcc, sizeof(buf));
   bufferlist bl;
@@ -857,6 +857,7 @@ TEST_F(LibRadosIoECPP, CrcZeroWrite) {
   ObjectReadOperation read;
   read.read(0, bl.length(), NULL, NULL);
   ASSERT_EQ(0, ioctx.operate("foo", &read, &bl));
+  recreate_pool();
 }
 
 TEST_F(LibRadosIoECPP, XattrListPP) {
index faa303427534059650c9303b9c7df2c2add3daed..75c05cc20410f72d031c1189e8ba604eeac60a3b 100644 (file)
@@ -401,16 +401,18 @@ void RadosTestECPP::TearDown()
     cleanup_default_namespace(ioctx);
     cleanup_namespace(ioctx, nspace);
   }
-  if (ec_overwrites_set) {
-    ASSERT_EQ(0, destroy_one_ec_pool_pp(pool_name, s_cluster));
-    ASSERT_EQ("", create_one_ec_pool_pp(pool_name, s_cluster));
-    ec_overwrites_set = false;
-  }
   ioctx.close();
 }
 
-void RadosTestECPP::set_allow_ec_overwrites()
+void RadosTestECPP::recreate_pool()
 {
-  ASSERT_EQ("", set_allow_ec_overwrites_pp(pool_name, cluster, true));
-  ec_overwrites_set = true;
+  SKIP_IF_CRIMSON();
+  ASSERT_EQ(0, destroy_one_ec_pool_pp(pool_name, s_cluster));
+  ASSERT_EQ("", create_one_ec_pool_pp(pool_name, s_cluster));
+  SetUp();
 }
+
+void RadosTestECPP::set_allow_ec_overwrites(std::string pool, bool allow)
+{
+  ASSERT_EQ("", set_allow_ec_overwrites_pp(pool, cluster, allow));
+}
\ No newline at end of file
index 15b7df8171b7fccfe617808a3cac646f0a623678..3fd5f9c607763e48d0531eb73cff75a925fcb64a 100644 (file)
@@ -111,14 +111,14 @@ protected:
 };
 
 class RadosTestECPP : public RadosTestPP {
-  bool ec_overwrites_set = false;
 public:
   RadosTestECPP(bool c=false) : cluster(s_cluster), cleanup(c) {}
   ~RadosTestECPP() override {}
 protected:
   static void SetUpTestCase();
   static void TearDownTestCase();
-  void set_allow_ec_overwrites();
+  void recreate_pool();
+  void set_allow_ec_overwrites(std::string pool, bool allow=true);
   static librados::Rados s_cluster;
   static std::string pool_name;