summaryrefslogtreecommitdiffstats
path: root/features/step_definitions/erase_memory.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/step_definitions/erase_memory.rb')
-rw-r--r--features/step_definitions/erase_memory.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb
index 21ea7bd..3625360 100644
--- a/features/step_definitions/erase_memory.rb
+++ b/features/step_definitions/erase_memory.rb
@@ -205,10 +205,23 @@ 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
- # We spam keypresses to prevent console blanking from hiding the
- # image we're waiting for
- @screen.type(" ")
- @screen.find('MemoryWipeCompleted.png')
+ match = nil
+ begin
+ try_for(memory_wipe_timeout, msg: "memory wipe didn't finish, probably the VM crashed") do
+ # We spam keypresses to prevent console blanking from hiding the
+ # image we're waiting for
+ @screen.type(" ")
+ match, _ = @screen.findAny(
+ ['MemoryWipeCompleted.png', 'TailsBug11786a.png', 'TailsBug11786b.png']
+ )
+ match != nil
+ end
+ # Just throw the same exception as a if the try_for would fail
+ raise Timeout::Error if match != 'MemoryWipeCompleted.png'
+ rescue Timeout::Error
+ puts "Cannot tell if memory wipe completed. " +
+ "One possible reason for this is #11786, " +
+ "so let's go on and rely on the next steps to check " +
+ "how well memory was wiped."
end
end