mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
tests: verify RBD flags are updated when enabling/disabling features
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
parent
46b19cb7e1
commit
882b370052
@ -2887,13 +2887,27 @@ TEST_F(TestLibRBD, UpdateFeatures)
|
||||
ASSERT_EQ(0, image.update_features(RBD_FEATURE_OBJECT_MAP |
|
||||
RBD_FEATURE_FAST_DIFF, true));
|
||||
|
||||
uint64_t expected_flags = RBD_FLAG_OBJECT_MAP_INVALID |
|
||||
RBD_FLAG_FAST_DIFF_INVALID;
|
||||
uint64_t flags;
|
||||
ASSERT_EQ(0, image.get_flags(&flags));
|
||||
ASSERT_EQ(expected_flags, flags);
|
||||
|
||||
// cannot disable object map w/ fast diff
|
||||
ASSERT_EQ(-EINVAL, image.update_features(RBD_FEATURE_OBJECT_MAP, false));
|
||||
ASSERT_EQ(0, image.update_features(RBD_FEATURE_FAST_DIFF, false));
|
||||
|
||||
expected_flags = RBD_FLAG_OBJECT_MAP_INVALID;
|
||||
ASSERT_EQ(0, image.get_flags(&flags));
|
||||
ASSERT_EQ(expected_flags, flags);
|
||||
|
||||
// cannot disable exclusive lock w/ object map
|
||||
ASSERT_EQ(-EINVAL, image.update_features(RBD_FEATURE_EXCLUSIVE_LOCK, false));
|
||||
ASSERT_EQ(0, image.update_features(RBD_FEATURE_OBJECT_MAP, false));
|
||||
|
||||
ASSERT_EQ(0, image.get_flags(&flags));
|
||||
ASSERT_EQ(0U, flags);
|
||||
|
||||
ASSERT_EQ(0, image.update_features(RBD_FEATURE_EXCLUSIVE_LOCK, false));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user