From c335855e971334c76abd13c722d57ee9e423ea74 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 17 Mar 2016 11:56:04 -0700 Subject: [PATCH] test/librados/tier.cc: Fix Whiteout tests to force promotion Otherwise, there may not actually be whiteouts created. Fixes: 15177 Signed-off-by: Samuel Just --- src/test/librados/tier.cc | 42 +++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/test/librados/tier.cc b/src/test/librados/tier.cc index 38bace6c1f7..0ff1c946b20 100755 --- a/src/test/librados/tier.cc +++ b/src/test/librados/tier.cc @@ -619,10 +619,25 @@ TEST_F(LibRadosTwoPoolsPP, Whiteout) { cluster.wait_for_latest_osdmap(); // create some whiteouts, verify they behave - ASSERT_EQ(0, ioctx.remove("foo")); + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(0, ioctx.operate("foo", &op)); + } - ASSERT_EQ(-ENOENT, ioctx.remove("bar")); - ASSERT_EQ(-ENOENT, ioctx.remove("bar")); + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(-ENOENT, ioctx.operate("bar", &op)); + } + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(-ENOENT, ioctx.operate("bar", &op)); + } // verify the whiteouts are there in the cache tier { @@ -3181,10 +3196,25 @@ TEST_F(LibRadosTwoPoolsECPP, Whiteout) { cluster.wait_for_latest_osdmap(); // create some whiteouts, verify they behave - ASSERT_EQ(0, ioctx.remove("foo")); + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(0, ioctx.operate("foo", &op)); + } - ASSERT_EQ(-ENOENT, ioctx.remove("bar")); - ASSERT_EQ(-ENOENT, ioctx.remove("bar")); + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(-ENOENT, ioctx.operate("bar", &op)); + } + { + ObjectWriteOperation op; + op.assert_exists(); + op.remove(); + ASSERT_EQ(-ENOENT, ioctx.operate("bar", &op)); + } // verify the whiteouts are there in the cache tier { -- 2.47.3