[functional tests] upgrade to Ruby 2.4.1

This commit is contained in:
Joe Thornber 2017-07-28 10:38:36 +01:00
parent 0a06e4b21b
commit 53e3d5f962
5 changed files with 53 additions and 36 deletions

View File

@ -1 +1 @@
1.9.3 2.4.1

View File

@ -1,7 +1,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
group :test do group :test do
gem 'cucumber' gem 'cucumber', '~> 2.4.0'
gem 'aruba' gem 'aruba'
gem 'thinp_xml' gem 'thinp_xml', :path => "/home/ejt/work/RedHat/thinp_xml"
end end

View File

@ -1,37 +1,53 @@
PATH
remote: /home/ejt/work/RedHat/thinp_xml
specs:
thinp_xml (0.0.22)
ejt_command_line (>= 0.0.2)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
aruba (0.6.1) aruba (0.14.2)
childprocess (>= 0.3.6) childprocess (~> 0.5.6)
cucumber (>= 1.1.1) contracts (~> 0.9)
rspec-expectations (>= 2.7.0) cucumber (>= 1.3.19)
builder (3.2.2) ffi (~> 1.9.10)
childprocess (0.5.3) rspec-expectations (>= 2.99)
thor (~> 0.19)
builder (3.2.3)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11) ffi (~> 1.0, >= 1.0.11)
cucumber (1.3.16) contracts (0.16.0)
cucumber (2.4.0)
builder (>= 2.1.2) builder (>= 2.1.2)
cucumber-core (~> 1.5.0)
cucumber-wire (~> 0.0.1)
diff-lcs (>= 1.1.3) diff-lcs (>= 1.1.3)
gherkin (~> 2.12) gherkin (~> 4.0)
multi_json (>= 1.7.5, < 2.0) multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1) multi_test (>= 0.1.2)
diff-lcs (1.2.5) cucumber-core (1.5.0)
gherkin (~> 4.0)
cucumber-wire (0.0.1)
diff-lcs (1.3)
ejt_command_line (0.0.4) ejt_command_line (0.0.4)
ffi (1.9.3) ffi (1.9.18)
gherkin (2.12.2) gherkin (4.1.3)
multi_json (~> 1.3) multi_json (1.12.1)
multi_json (1.10.1) multi_test (0.1.2)
multi_test (0.1.1) rspec-expectations (3.6.0)
rspec-expectations (3.0.4)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0) rspec-support (~> 3.6.0)
rspec-support (3.0.4) rspec-support (3.6.0)
thinp_xml (0.0.20) thor (0.19.4)
ejt_command_line (>= 0.0.2)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
aruba aruba
cucumber cucumber (~> 2.4.0)
thinp_xml thinp_xml!
BUNDLED WITH
1.15.3

View File

@ -7,7 +7,7 @@ end
Given /^input without read permissions$/ do Given /^input without read permissions$/ do
write_file(DEFAULT_INPUT, "\0" * 4096) write_file(DEFAULT_INPUT, "\0" * 4096)
in_current_dir do cd(".") do
f = File.new(DEFAULT_INPUT) f = File.new(DEFAULT_INPUT)
f.chmod(0000) f.chmod(0000)
end end
@ -18,7 +18,7 @@ Given(/^input file$/) do
end end
Given(/^block (\d+) is zeroed$/) do |b| Given(/^block (\d+) is zeroed$/) do |b|
in_current_dir do cd(".") do
File.open(DEFAULT_INPUT, 'w') do |f| File.open(DEFAULT_INPUT, 'w') do |f|
f.seek(BLOCK_SIZE * b.to_i, IO::SEEK_SET) f.seek(BLOCK_SIZE * b.to_i, IO::SEEK_SET)
f.write("\0" * BLOCK_SIZE) f.write("\0" * BLOCK_SIZE)
@ -27,11 +27,11 @@ Given(/^block (\d+) is zeroed$/) do |b|
end end
Then /^it should pass$/ do Then /^it should pass$/ do
assert_success(true) expect(last_command_started).to be_successfully_executed
end end
Then /^it should fail$/ do Then /^it should fail$/ do
assert_success(false) expect(last_command_started).to_not be_successfully_executed
end end
CACHE_USAGE =<<EOF CACHE_USAGE =<<EOF
@ -44,14 +44,15 @@ Options:
{--super-block-only} {--super-block-only}
{--skip-mappings} {--skip-mappings}
{--skip-hints} {--skip-hints}
{--skip-discards}
EOF EOF
Then /^cache_usage to stdout$/ do Then /^cache_usage to stdout$/ do
assert_partial_output(CACHE_USAGE, all_stdout) expect(last_command_started).to have_output_on_stdout(CACHE_USAGE.chomp)
end end
Then /^cache_usage to stderr$/ do Then /^cache_usage to stderr$/ do
assert_partial_output(CACHE_USAGE, all_stderr) expect(last_command_started).to have_output_on_stderr("No input file provided.\n" + CACHE_USAGE.chomp)
end end
When(/^I run cache_check with (.*?)$/) do |opts| When(/^I run cache_check with (.*?)$/) do |opts|
@ -79,7 +80,7 @@ When(/^I run cache_metadata_size$/) do
end end
Given(/^valid cache metadata$/) do Given(/^valid cache metadata$/) do
in_current_dir do cd(".") do
system("cache_xml create --nr-cache-blocks uniform[1000..5000] --nr-mappings uniform[500..1000] > #{xml_file}") system("cache_xml create --nr-cache-blocks uniform[1000..5000] --nr-mappings uniform[500..1000] > #{xml_file}")
system("dd if=/dev/zero of=#{dev_file} bs=4k count=1024 > /dev/null") system("dd if=/dev/zero of=#{dev_file} bs=4k count=1024 > /dev/null")
end end
@ -92,7 +93,7 @@ Then(/^cache dumps (\d+) and (\d+) should be identical$/) do |d1, d2|
end end
Given(/^a small xml file$/) do Given(/^a small xml file$/) do
in_current_dir do cd(".") do
system("cache_xml create --nr-cache-blocks 3 --nr-mappings 3 --layout linear --dirty-percent 100 > #{xml_file}") system("cache_xml create --nr-cache-blocks 3 --nr-mappings 3 --layout linear --dirty-percent 100 > #{xml_file}")
end end
end end

View File

@ -42,13 +42,13 @@ When(/^I run thin_restore with (.*?)$/) do |opts|
end end
Then /^it should give no output$/ do Then /^it should give no output$/ do
ps = only_processes.last ps = all_commands.last
output = ps.stdout + ps.stderr output = ps.stdout + ps.stderr
output.should == "" expect(output).to eq("")
end end
Then(/^it should pass with version$/) do Then(/^it should pass with version$/) do
only_processes.last.stdout.chomp.should == tools_version expect(all_commands.last.stdout.chomp).to eq(tools_version)
end end
When(/^I dump$/) do When(/^I dump$/) do