#include "crimson/os/seastore/random_block_manager/rbm_device.h"
#include "crimson/os/seastore/journal/circular_bounded_journal.h"
#include "crimson/os/seastore/random_block_manager/block_rb_manager.h"
+#ifdef UNIT_TESTS_BUILT
+#include "test/crimson/gtest_seastar.h"
+#endif
using namespace crimson;
using namespace crimson::os;
void set_primary_device_ref(DeviceRef) final;
};
-class EphemeralTestState {
+class EphemeralTestState
+#ifdef UNIT_TESTS_BUILT
+ : public ::testing::WithParamInterface<const char*> {
+#else
+ {
+#endif
protected:
journal_type_t journal_type;
size_t num_main_device_managers = 0;
restart_fut().get0();
}
- seastar::future<> tm_setup(
- journal_type_t type = journal_type_t::SEGMENTED) {
+ seastar::future<> tm_setup() {
LOG_PREFIX(EphemeralTestState::tm_setup);
- journal_type = type;
- if (journal_type == journal_type_t::SEGMENTED) {
- devices.reset(new
- EphemeralSegmentedDevices(
- num_main_device_managers, num_cold_device_managers));
- } else {
- assert(journal_type == journal_type_t::RANDOM_BLOCK);
+#ifdef UNIT_TESTS_BUILT
+ std::string j_type = GetParam();
+#else
+ std::string j_type = "segmented";
+#endif
+ if (j_type == "circularbounded") {
//TODO: multiple devices
ceph_assert(num_main_device_managers == 1);
ceph_assert(num_cold_device_managers == 0);
devices.reset(new EphemeralRandomBlockDevices(1));
+ } else {
+ // segmented by default
+ devices.reset(new
+ EphemeralSegmentedDevices(
+ num_main_device_managers, num_cold_device_managers));
}
SUBINFO(test, "begin with {} devices ...", devices->get_num_devices());
return devices->setup(