diff --git a/needles/console/anaconda_rescue_enter_password.json b/needles/console/anaconda_rescue_enter_password.json new file mode 100644 index 00000000..f99d8024 --- /dev/null +++ b/needles/console/anaconda_rescue_enter_password.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 1, + "ypos": 546, + "width": 85, + "height": 12, + "type": "match" + } + ], + "tags": [ + "rescue_enter_pass" + ] +} \ No newline at end of file diff --git a/needles/console/anaconda_rescue_enter_password.png b/needles/console/anaconda_rescue_enter_password.png new file mode 100644 index 00000000..8ed76ec5 Binary files /dev/null and b/needles/console/anaconda_rescue_enter_password.png differ diff --git a/needles/console/anaconda_rescue_mounted.json b/needles/console/anaconda_rescue_mounted.json new file mode 100644 index 00000000..54cb1779 --- /dev/null +++ b/needles/console/anaconda_rescue_mounted.json @@ -0,0 +1,22 @@ +{ + "tags": [ + "rescue_mounted" + ], + "area": [ + { + "xpos": 1, + "ypos": 593, + "width": 93, + "height": 13, + "type": "match" + }, + { + "xpos": 57, + "ypos": 722, + "width": 102, + "height": 13, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/console/anaconda_rescue_mounted.png b/needles/console/anaconda_rescue_mounted.png new file mode 100644 index 00000000..e7d6b14e Binary files /dev/null and b/needles/console/anaconda_rescue_mounted.png differ diff --git a/needles/console/anaconda_select_rescue.json b/needles/console/anaconda_select_rescue.json new file mode 100644 index 00000000..56d1dedf --- /dev/null +++ b/needles/console/anaconda_select_rescue.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 2, + "ypos": 146, + "width": 45, + "height": 13, + "type": "match" + }, + { + "xpos": 55, + "ypos": 434, + "width": 127, + "height": 10, + "type": "match" + } + ], + "tags": [ + "rescue_select" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/console/anaconda_select_rescue.png b/needles/console/anaconda_select_rescue.png new file mode 100644 index 00000000..cf86accd Binary files /dev/null and b/needles/console/anaconda_select_rescue.png differ diff --git a/templates b/templates index f2c67d48..7cd6d4a3 100755 --- a/templates +++ b/templates @@ -336,6 +336,17 @@ }, test_suite => { name => "install_anaconda_text" }, }, + { + machine => { name => "64bit" }, + prio => 31, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "install_rescue_encrypted" }, + }, { machine => { name => "64bit" }, prio => 10, @@ -1469,6 +1480,14 @@ { key => "ANACONDA_TEXT", value => "1" }, ], }, + { + name => "install_rescue_encrypted", + settings => [ + { key => "ENTRYPOINT", value => "rescue_mode_encrypted" }, + { key => "HDD_1", value => "disk_%MACHINE%_encrypted.qcow2" }, + { key => "START_AFTER_TEST", value => "install_simple_encrypted" }, + ], + }, { name => "install_package_set_minimal", settings => [ @@ -1561,6 +1580,7 @@ name => "install_simple_encrypted", settings => [ { key => "ENCRYPT_PASSWORD", value => "weakpassword" }, + { key => "STORE_HDD_1", value => "disk_%MACHINE%_encrypted.qcow2" }, ], }, { diff --git a/tests/rescue_mode_encrypted.pm b/tests/rescue_mode_encrypted.pm new file mode 100644 index 00000000..8a1f80a1 --- /dev/null +++ b/tests/rescue_mode_encrypted.pm @@ -0,0 +1,43 @@ +use base "anacondatest"; +use strict; +use testapi; + +sub run { + # handle bootloader screen + assert_screen "bootloader", 30; + # select troubleshooting + send_key "down"; + send_key "ret"; + # select "rescue system" + type_string "r\n"; + + assert_screen "rescue_select", 120; # it takes time to start anaconda + # continue + type_string "1\n"; + assert_screen "rescue_enter_pass", 60; # it might take time to scan all disks + type_string get_var("ENCRYPT_PASSWORD", "weakpassword"); + send_key "ret"; + assert_screen "rescue_mounted", 60; # it also might take time to mount disk + send_key "ret"; + + # check whether disk was mounted + validate_script_output "mount", sub { $_ =~ m/\/mnt\/sysimage/ }; + # try to access home in chroot + assert_script_run "chroot /mnt/sysimage ls -la /home/test"; + # try to write and read a file + assert_script_run "chroot /mnt/sysimage /bin/bash -c 'echo Hello, world > /tmp/openqa_test'"; + validate_script_output "chroot /mnt/sysimage cat /tmp/openqa_test", sub { $_ =~ m/Hello, world/ }; +} + + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: