From 7676343c781e9c15e18c5960d221a29840835332 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 23 Dec 2015 10:31:07 -0500 Subject: [PATCH] tests: rebuild exclusive lock test should acquire exclusive lock Starting with Jewel, the object map will not be loaded until the exclusive lock is acquired since it might be updated by the lock owner. Fixes: #14121 Signed-off-by: Jason Dillaman --- src/test/librbd/test_librbd.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 689e285267bd..09eeb6595b75 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -3059,6 +3059,12 @@ TEST_F(TestLibRBD, RebuildObjectMap) librbd::Image image1; ASSERT_EQ(0, rbd.open(ioctx, image1, name.c_str(), NULL)); + bool lock_owner; + bl.clear(); + ASSERT_EQ(0, image1.write(0, 0, bl)); + ASSERT_EQ(0, image1.is_exclusive_lock_owner(&lock_owner)); + ASSERT_TRUE(lock_owner); + uint64_t flags; ASSERT_EQ(0, image1.get_flags(&flags)); ASSERT_TRUE((flags & RBD_FLAG_OBJECT_MAP_INVALID) != 0); -- 2.47.3