[thin_check] Start refactoring metadata_checker.

This commit is contained in:
Joe Thornber
2013-04-23 15:21:44 +01:00
parent 70fd048426
commit 20ff78c818
12 changed files with 302 additions and 123 deletions

View File

@@ -7,7 +7,20 @@ Given(/^valid metadata$/) do
run_simple("thin_restore -i #{xml_file} -o #{dev_file}")
end
When(/^I run thin_check with (.*?)$/) do |opts|
run "thin_check #{opts} #{dev_file}"
Given(/^a corrupt superblock$/) do
in_current_dir do
write_valid_xml(xml_file)
end
run_simple("dd if=/dev/zero of=#{dev_file} bs=4k count=1024")
run_simple("thin_restore -i #{xml_file} -o #{dev_file}")
in_current_dir do
corrupt_block(0)
end
end
When(/^I run thin_check with (.*?)$/) do |opts|
run_simple("thin_check #{opts} #{dev_file}", false)
end