From 42746d9dec06ce92701b77d017c4c5d048fb1093 Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Mon, 20 Mar 2017 16:16:21 +0100 Subject: lvc: make sure we wait long enough for the grub.cfg to be present this adds a tweaked version of the generic image finder, to avoid trying to mention diui_png() in the cucumber code Signed-off-by: Holger Levsen --- cucumber/features/install.feature | 1 + cucumber/features/step_definitions/common_steps.rb | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'cucumber/features') diff --git a/cucumber/features/install.feature b/cucumber/features/install.feature index 93d1c332..8d291d84 100644 --- a/cucumber/features/install.feature +++ b/cucumber/features/install.feature @@ -111,6 +111,7 @@ Feature: Doing variations on d-i installs And running "grep fsck /target/etc/modprobe.d/local.conf" fails And I wait while the bulk of the packages are installed And I install GRUB + And I see the "InstallComplete" screen, after at most 240 seconds And running "grep wibble /target/boot/grub/grub.cfg" succeeds And I allow reboot after the install is complete And I wait for the reboot diff --git a/cucumber/features/step_definitions/common_steps.rb b/cucumber/features/step_definitions/common_steps.rb index 0cebc1a3..feec90e2 100644 --- a/cucumber/features/step_definitions/common_steps.rb +++ b/cucumber/features/step_definitions/common_steps.rb @@ -669,7 +669,7 @@ Given /^I install GRUB$/ do end Given /^I allow reboot after the install is complete$/ do - @screen.wait(diui_png("InstallComplete"), 4 * 60 * PATIENCE) + step('I see the "InstallComplete" screen, after at most 240 seconds') @screen.type(Sikuli::Key.ENTER) end @@ -880,6 +880,15 @@ Then /^I (do not )?see "([^"]*)" after at most (\d+) seconds$/ do |negation, ima end end +Then /^I (do not )?see the "([^"]*)" screen, after at most (\d+) seconds$/ do |negation, image, time| + begin + @screen.wait(diui_png(image), time.to_i) + raise "found '" + diui_png(image) + "' while expecting not to" if negation + rescue FindFailed => e + raise e if not(negation) + end +end + Then /^all Internet traffic has only flowed through Tor$/ do leaks = FirewallLeakCheck.new(@sniffer.pcap_file, :accepted_hosts => get_all_tor_nodes) -- cgit v1.2.3-70-g09d2