From: Samuel Just Date: Thu, 17 Mar 2016 18:56:04 +0000 (-0700) Subject: test/librados/tier.cc: Fix Whiteout tests to force promotion X-Git-Tag: v10.1.1~142^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c335855e971334c76abd13c722d57ee9e423ea74;p=ceph.git 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 --- diff --git a/src/test/librados/tier.cc b/src/test/librados/tier.cc index 38bace6c1f7b..0ff1c946b20d 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 {