Start device_checker
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "test_utils.h"
|
||||
|
||||
#include "persistent-data/block.h"
|
||||
#include "thin-provisioning/device_checker.h"
|
||||
#include "thin-provisioning/restore_emitter.h"
|
||||
#include "thin-provisioning/superblock_checker.h"
|
||||
|
||||
@ -110,21 +111,34 @@ namespace {
|
||||
block_manager<>::ptr bm_;
|
||||
};
|
||||
|
||||
class SuperBlockCheckerTests : public Test {
|
||||
//--------------------------------
|
||||
|
||||
class MetadataCheckerTests : public Test {
|
||||
public:
|
||||
SuperBlockCheckerTests()
|
||||
MetadataCheckerTests()
|
||||
: bm_(create_bm<BLOCK_SIZE>()) {
|
||||
|
||||
metadata_builder builder(bm_);
|
||||
builder.build();
|
||||
}
|
||||
|
||||
with_temp_directory dir_;
|
||||
block_manager<>::ptr bm_;
|
||||
|
||||
};
|
||||
|
||||
class SuperBlockCheckerTests : public MetadataCheckerTests {
|
||||
public:
|
||||
void corrupt_superblock() {
|
||||
zero_block(bm_, SUPERBLOCK_LOCATION);
|
||||
}
|
||||
};
|
||||
|
||||
with_temp_directory dir_;
|
||||
block_manager<>::ptr bm_;
|
||||
//--------------------------------
|
||||
|
||||
class DevicesCheckerTests : public MetadataCheckerTests {
|
||||
public:
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -155,3 +169,10 @@ TEST_F(SuperBlockCheckerTests, fails_with_bad_checksum)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
TEST_F(DevicesCheckerTests, create_require_a_block_manager)
|
||||
{
|
||||
device_checker dc(bm_);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user