store->umount();
mounted = false;
}
+ bool bdev_supports_label() {
+ BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
+ if (!bstore) return false;
+ auto bdev = bstore->get_bdev();
+ if (!bdev) return false;
+ return bdev->supported_bdev_label();
+ }
bool corrupt_disk_at(uint64_t position) {
int fd = -1;
auto close_fd = make_scope_guard([&] {
SetVal(g_conf(), "bluestore_bdev_label_multi", "false");
g_conf().apply_changes(nullptr);
DeferredSetup();
- store->umount();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
+ umount();
bluestore_bdev_label_t label;
int r = BlueStore::_read_bdev_label(
g_ceph_context, get_data_dir() + "/block", &label, 0);
ASSERT_EQ(r, 0);
ASSERT_EQ(label.meta.end(), label.meta.find("multi"));
- store->mount();
+ mount();
}
TEST_P(MultiLabelTest, MultiSelectableOn) {
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
- store->umount();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
+ umount();
bluestore_bdev_label_t label;
int r = BlueStore::_read_bdev_label(
g_ceph_context, get_data_dir() + "/block", &label, 0);
auto it = label.meta.find("multi");
ASSERT_NE(label.meta.end(), it);
ASSERT_EQ(it->second, "yes");
- store->mount();
+ mount();
}
TEST_P(MultiLabelTest, DetectCorruptedFirst) {
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bool corrupt = corrupt_disk_at(0);
ASSERT_EQ(corrupt, true);
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bool corrupt = corrupt_disk_at(0);
ASSERT_EQ(corrupt, true);
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bool corrupt = corrupt_disk_at(0);
ASSERT_EQ(corrupt, true);
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bool corrupt = corrupt_disk_at(0);
ASSERT_EQ(corrupt, true);
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bool corrupt = corrupt_disk_at(0);
ASSERT_EQ(corrupt, true);
SetVal(g_conf(), "bluestore_bdev_label_multi", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
bluestore_bdev_label_t label;
int r = BlueStore::_read_bdev_label(
SetVal(g_conf(), "bluestore_bdev_label_multi_upgrade", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
umount();
ASSERT_EQ(store->repair(false), 0);
ASSERT_EQ(store->fsck(false), 0);
SetVal(g_conf(), "bluestore_bdev_label_multi_upgrade", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
//fill BlueFS with data
BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
ceph_assert(bstore);
SetVal(g_conf(), "bluestore_bdev_label_multi_upgrade", "true");
g_conf().apply_changes(nullptr);
DeferredSetup();
+ if (!bdev_supports_label()) {
+ GTEST_SKIP();
+ }
//fill with object data
coll_t cid;
auto ch = store->create_new_collection(cid);