1 Given /^I start the computer from DVD with network unplugged( and an unsupported graphics card)?$/ do |graphics_card|
3 @boot_options = 'autotest_broken_gnome_shell'
5 @wait_for_remote_shell = true
7 step 'the computer is set to boot from the Tails DVD'
8 step 'the network is unplugged'
9 step 'I start the computer'
13 When /^Tails detects disk read failures on the (.+)$/ do |device|
14 disk_ioerrors = '/var/lib/live/tails.disk.ioerrors'
15 fake_ioerror_script_path = '/tmp/fake_ioerror.py'
19 fake_error = 'SQUASHFS error: A fake error.'
21 b_d = boot_device.delete_prefix('/dev/').delete_suffix('1')
22 fake_error = "I/O error, dev #{b_d}, sector - a fake boot device one."
23 when 'boot device with a target error'
24 b_d = boot_device.delete_prefix('/dev/').delete_suffix('1')
25 fake_error = "critical target error, dev #{b_d}, sector - a fake boot device one."
28 fake_ioerror_script = <<~FAKEIOERROR
29 from systemd import journal
30 journal.send("#{fake_error}", SYSLOG_IDENTIFIER="kernel", PRIORITY=3)
32 $vm.file_overwrite(fake_ioerror_script_path, fake_ioerror_script)
33 $vm.execute_successfully(
34 'systemctl --quiet is-active tails-detect-disk-ioerrors'
36 $vm.execute_successfully("python3 #{fake_ioerror_script_path}")
37 try_for(60) { $vm.file_exist?(disk_ioerrors) }
38 RemoteShell::SignalReady.new($vm)
41 Then /^I see a disk failure message$/ do
42 @screen.wait('GnomeDiskFailureMessage.png', 10)
45 Then /^I see an error about (disk partitioning|GPT header|system partition resizing)$/ do |reason|
46 error_message_prefix = 'Something went wrong when starting your Tails USB stick' \
47 ' for the first time: '
49 'disk partitioning' => '',
50 'GPT header' => 'the GPT header is corrupted',
51 'system partition resizing' => 'resizing the system partition failed',
53 error_message = error_message_prefix + reason_to_message[reason]
55 Dogtail::Application.new('zenity')
56 .children(roleName: 'label')
57 .any? { |n| n.text.include?(error_message) }
61 Then /^I see a disk failure message on the splash screen$/ do
62 @screen.wait('PlymouthDiskFailureMessage.png', 60)
65 Then /^I can open the hardware failure documentation from the disk failure message$/ do
66 click_gnome_shell_notification_button('Learn More')
67 try_for(60) { @torbrowser = Dogtail::Application.new('Firefox') }
68 step '"Tails - Error Reading Data from Tails USB Stick" has loaded in the Tor Browser'
71 Then /^I see a graphics card failure message on the splash screen$/ do
72 @screen.wait('PlymouthGraphicsCardFailureMessage.png', 60)