[all] Build a single executable

This commit is contained in:
Joe Thornber
2014-08-27 14:01:31 +01:00
parent c1e0799367
commit 6f8b7e2914
48 changed files with 418 additions and 496 deletions

View File

@@ -1,4 +1,4 @@
Feature: thin_restore
Feature: cache_restore
Scenario: print version (-V flag)
When I run cache_restore with -V
Then it should pass with version
@@ -84,15 +84,15 @@ Feature: thin_restore
Then it should pass
Scenario: --quiet is accepted
Given valid metadata
When I run thin_restore with -i metadata.xml -o metadata.bin --quiet
Given valid cache metadata
When I run cache_restore with -i metadata.xml -o metadata.bin --quiet
Then it should pass with:
"""
"""
Scenario: -q is accepted
Given valid metadata
When I run thin_restore with -i metadata.xml -o metadata.bin -q
Given valid cache metadata
When I run cache_restore with -i metadata.xml -o metadata.bin -q
Then it should pass with:
"""
"""

View File

@@ -1,4 +1,4 @@
Feature: thin_restore
Feature: era_restore
Scenario: print version (-V flag)
When I run era_restore with -V
Then it should pass with version
@@ -67,15 +67,15 @@ Feature: thin_restore
And the metadata should be valid
Scenario: --quiet is accepted
Given valid metadata
When I run thin_restore with -i metadata.xml -o metadata.bin --quiet
Given valid era metadata
When I run era_restore with -i metadata.xml -o metadata.bin --quiet
Then it should pass with:
"""
"""
Scenario: -q is accepted
Given valid metadata
When I run thin_restore with -i metadata.xml -o metadata.bin -q
Given valid era metadata
When I run era_restore with -i metadata.xml -o metadata.bin -q
Then it should pass with:
"""
"""

View File

@@ -29,3 +29,11 @@ Then(/^the metadata should be valid$/) do
run_simple("era_check #{dev_file}", true)
end
Given(/^valid era metadata$/) do
in_current_dir do
system("era_xml create --nr-blocks 100 --nr-writesets 2 --current-era 1000 > #{xml_file}")
end
run_simple("dd if=/dev/zero of=#{dev_file} bs=4k count=1024")
run_simple("era_restore -i #{xml_file} -o #{dev_file}")
end

View File

@@ -1,4 +1,4 @@
Given(/^valid metadata$/) do
Given(/^valid thin metadata$/) do
in_current_dir do
system("thinp_xml create --nr-thins uniform[4..9] --nr-mappings uniform[1000..10000] > #{xml_file}")
end
@@ -58,7 +58,7 @@ Then(/^dumps ([0-9]+) and ([0-9]+) should be identical$/) do |d1, d2|
run_simple("diff -ub #{dump_files[d1.to_i]} #{dump_files[d2.to_i]}", true)
end
Given(/^small metadata$/) do
Given(/^small thin metadata$/) do
in_current_dir do
system("thinp_xml create --nr-thins 2 --nr-mappings 1 > #{xml_file}")
end

View File

@@ -1,3 +1,3 @@
require 'aruba/cucumber'
ENV['PATH'] = "#{Dir::pwd}:#{ENV['PATH']}"
ENV['PATH'] = "#{Dir::pwd}/bin:#{ENV['PATH']}"

View File

@@ -44,7 +44,7 @@ Feature: thin_check
Then it should fail
Scenario: --super-block-only check passes on valid metadata
Given valid metadata
Given valid thin metadata
When I run thin_check with --super-block-only
Then it should pass
@@ -59,12 +59,12 @@ Feature: thin_check
"""
Scenario: --skip-mappings check passes on valid metadata
Given valid metadata
Given valid thin metadata
When I run thin_check with --skip-mappings
Then it should pass
Scenario: --ignore-non-fatal-errors check passes on valid metadata
Given valid metadata
Given valid thin metadata
When I run thin_check with --ignore-non-fatal-errors
Then it should pass
@@ -81,6 +81,6 @@ Feature: thin_check
And it should give no output
Scenario: Accepts --clear-needs-check-flag
Given valid metadata
Given valid thin metadata
When I run thin_check with --clear-needs-check-flag
Then it should pass

View File

@@ -56,32 +56,32 @@ Feature: thin_restore
"""
Scenario: --quiet is accepted
Given valid metadata
Given valid thin metadata
When I run thin_restore with -i metadata.xml -o metadata.bin --quiet
Then it should pass with:
"""
"""
Scenario: -q is accepted
Given valid metadata
Given valid thin metadata
When I run thin_restore with -i metadata.xml -o metadata.bin -q
Then it should pass with:
"""
"""
Scenario: dump/restore is a noop
Given valid metadata
Given valid thin metadata
When I dump
And I restore
And I dump
Then dumps 1 and 2 should be identical
Scenario: dump matches original metadata
Given valid metadata
Given valid thin metadata
When I dump
Then dumps 0 and 1 should be identical
Scenario: dump matches original metadata (small)
Given small metadata
Given small thin metadata
When I dump
Then dumps 0 and 1 should be identical

View File

@@ -42,56 +42,56 @@ Feature: thin_rmap
@announce
Scenario: Valid region format should pass
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 23..7890
Then it should pass
Scenario: Invalid region format should fail (comma instean of dots)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 23,7890
Then it should fail
Scenario: Invalid region format should fail (second number a word)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 23..six
Then it should fail
Scenario: Invalid region format should fail (first number a word)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region four..7890
Then it should fail
Scenario: Invalid region format should fail (end is lower than begin)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 89..88
Then it should fail
Scenario: Invalid region format should fail (end is equal to begin)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 89..89
Then it should fail
Scenario: Invalid region format should fail (no begin)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region ..89
Then it should fail
Scenario: Invalid region format should fail (no end)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 89..
Then it should fail
Scenario: Invalid region format should fail (no region at all)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region
Then it should fail
Scenario: Invalid region format should fail (three dots)
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 89...99
Then it should fail
Scenario: Multiple regions should pass
Given valid metadata
Given valid thin metadata
When I run thin_rmap with --region 1..23 --region 45..78
Then it should pass