Start device_checker

This commit is contained in:
Joe Thornber
2013-04-29 13:24:19 +01:00
parent c0b14ce280
commit 1a8b1b29e8
6 changed files with 72 additions and 8 deletions

View File

@ -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_);
}
//----------------------------------------------------------------