mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-19 19:51:25 +00:00
add anaconda rescue test on encrypted disk
Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D995
This commit is contained in:
parent
4d3ed25d79
commit
c0b9bdb543
15
needles/console/anaconda_rescue_enter_password.json
Normal file
15
needles/console/anaconda_rescue_enter_password.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 1,
|
||||
"ypos": 546,
|
||||
"width": 85,
|
||||
"height": 12,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"rescue_enter_pass"
|
||||
]
|
||||
}
|
BIN
needles/console/anaconda_rescue_enter_password.png
Normal file
BIN
needles/console/anaconda_rescue_enter_password.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
22
needles/console/anaconda_rescue_mounted.json
Normal file
22
needles/console/anaconda_rescue_mounted.json
Normal 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": []
|
||||
}
|
BIN
needles/console/anaconda_rescue_mounted.png
Normal file
BIN
needles/console/anaconda_rescue_mounted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
22
needles/console/anaconda_select_rescue.json
Normal file
22
needles/console/anaconda_select_rescue.json
Normal 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": []
|
||||
}
|
BIN
needles/console/anaconda_select_rescue.png
Normal file
BIN
needles/console/anaconda_select_rescue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
20
templates
20
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" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
43
tests/rescue_mode_encrypted.pm
Normal file
43
tests/rescue_mode_encrypted.pm
Normal 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:
|
Loading…
Reference in New Issue
Block a user