From d69e87f6c154c2daaff7491c8c3272a45a89fc1d Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Fri, 21 Oct 2016 17:27:17 +0200 Subject: lvc: step to detect VM shutdown Signed-off-by: Holger Levsen --- cucumber/features/step_definitions/common_steps.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cucumber/features/step_definitions') diff --git a/cucumber/features/step_definitions/common_steps.rb b/cucumber/features/step_definitions/common_steps.rb index c40974f7..f98dee50 100644 --- a/cucumber/features/step_definitions/common_steps.rb +++ b/cucumber/features/step_definitions/common_steps.rb @@ -141,6 +141,13 @@ Given /^the computer has (\d+) ([[:alpha:]]+) of RAM$/ do |size, unit| $vm.set_ram_size(size, unit) end +Then /^the VM shuts down within (\d+) minutes$/ do |mins| + timeout = 60*mins.to_i + try_for(timeout, :msg => "VM is still running after #{timeout} seconds") do + ! $vm.is_running? + end +end + Given /^the computer is set to boot from the Tails DVD$/ do $vm.set_cdrom_boot(TAILS_ISO) end -- cgit v1.2.3-70-g09d2