1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-24 03:03:08 +00:00

add anaconda rescue test on encrypted disk

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D995
This commit is contained in:
Jan Sedlák 2016-09-16 14:44:03 +02:00
parent 4d3ed25d79
commit c0b9bdb543
8 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"properties": [],
"area": [
{
"xpos": 1,
"ypos": 546,
"width": 85,
"height": 12,
"type": "match"
}
],
"tags": [
"rescue_enter_pass"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -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": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -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": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -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" },
],
},
{

View File

@ -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: