summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-12-23 12:14:13 +0000
committerintrigeri <intrigeri@boum.org>2016-12-23 12:14:13 +0000
commitedd8dcd772cb2edf0acc071e49baa0549c2c05a5 (patch)
tree2b575a38a746392dec9c510517d25cc5b1b9171c
parent1b6be15a13cb79532e15eed1d66e6cd36033859b (diff)
Test suite: check memory wipe efficiency even when we can't tell whether it has successfully completed (refs: #12067).
-rw-r--r--features/step_definitions/erase_memory.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb
index 5828537..0966825 100644
--- a/features/step_definitions/erase_memory.rb
+++ b/features/step_definitions/erase_memory.rb
@@ -179,10 +179,25 @@ end
When /^I shutdown and wait for Tails to finish wiping the memory$/ do
$vm.spawn("halt")
- try_for(memory_wipe_timeout, { :msg => "memory wipe didn't finish, probably the VM crashed" }) do
+
+ check_if_memory_wipe_finished = Proc.new do
# We spam keypresses to prevent console blanking from hiding the
# image we're waiting for
@screen.type(" ")
@screen.find('MemoryWipeCompleted.png')
+ sleep 1
+ end
+
+ begin
+ retry_action(
+ memory_wipe_timeout,
+ :operation_name => "Checking if memory wipe has finished",
+ &check_if_memory_wipe_finished
+ )
+ rescue MaxRetriesFailure
+ puts "Cannot tell if memory wipe completed."
+ puts "One possible reason for this is a garbled display,"
+ puts "so let's go on and rely on the next steps to check"
+ puts "how well memory was wiped."
end
end