mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-12-22 02:38:31 +00:00
New install_repository_hd_variation
use a new PREINSTALL to execute a rescue script before install. This is covering the Hard_drive_variation test as per: https://fedoraproject.org/wiki/QA:Testcase_install_repository_Hard_drive_variation Signed-off-by: Guy Menanteau <menantea@linux.vnet.ibm.com>
This commit is contained in:
parent
4a00301725
commit
29070a54f1
@ -73,6 +73,7 @@ it also means that `B` conflicts `A` even if not shown in the table).
|
||||
| `USER_LOGIN` | string | not set | should be used with `USER_PASSWORD` (unless `false`) | when set, user login is set to this value. If not set, default value `test` is used for console installs, no login is done for graphical installs. If set to `false`, no user login will be done |
|
||||
| `USER_PASSWORD` | string | not set | should be used with `USER_LOGIN` | when set, user password is set to this value. If not set, default value `weakpassword` is used for console installs, no login is done for graphical installs |
|
||||
| `TEST_UPDATES` | boolean | `false`/not set | set to indicate that this test checks updates.img loading, so we should check for the expected effect of the updates image used for this testing |
|
||||
| `PREINSTALL` | string | not set | nothing | If set, specified module will be loaded before reboot and install; module supposed to be starting as rescue mode |
|
||||
| `POSTINSTALL` | string | not set | nothing | If set, `tests/(value)_postinstall.pm` will be loaded after install, boot, login, and other postinstall tests
|
||||
| `UEFI` | boolean | `false`/not set | nothing | whether to use UEFI, this variable isn't usually set in test suites but in machine definition |
|
||||
| `ANACONDA_TEXT` | boolean | `false`/not set | all | when specified, anaconda will run in text mode |
|
||||
|
@ -246,9 +246,9 @@ sub custom_delete_part {
|
||||
sub get_full_repo {
|
||||
my ($repourl) = @_;
|
||||
# trivial thing we kept repeating: fill out an HTTP or HTTPS
|
||||
# repo URL with flavor and arch, leave NFS ones alone (as for
|
||||
# NFS tests we just use a mounted ISO and the URL is complete)
|
||||
if ($repourl !~ m/^nfs/) {
|
||||
# repo URL with flavor and arch, leave hd & NFS ones alone
|
||||
# (as for those tests we just use a mounted ISO and URL is complete)
|
||||
if ($repourl !~ m/^(nfs|hd:)/) {
|
||||
# Everything variant doesn't exist for modular composes atm,
|
||||
# only Server
|
||||
my $variant = 'Everything';
|
||||
|
17
lib/utils.pm
17
lib/utils.pm
@ -7,7 +7,7 @@ use Exporter;
|
||||
|
||||
use lockapi;
|
||||
use testapi;
|
||||
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode/;
|
||||
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile/;
|
||||
|
||||
sub run_with_error_check {
|
||||
my ($func, $error_screen) = @_;
|
||||
@ -902,3 +902,18 @@ sub select_rescue_mode {
|
||||
|
||||
assert_screen "rescue_select", 120; # it takes time to start anaconda
|
||||
}
|
||||
|
||||
sub copy_devcdrom_as_isofile {
|
||||
# copy /dev/cdrom as iso file and verify checksum is same
|
||||
# as cdrom previously retrieved from ISO_URL
|
||||
my $isoname = shift;
|
||||
assert_script_run "dd if=/dev/cdrom of=$isoname", 360;
|
||||
# verify iso checksum
|
||||
my $cdurl = get_var('ISO_URL');
|
||||
my $cmd = <<EOF;
|
||||
urld="$cdurl"; urld=\${urld%/*}; chkf=\$(curl -fs \$urld/ |grep CHECKSUM | sed -E 's/.*href=.//; s/\".*//') && curl -f \$urld/\$chkf -o /tmp/x
|
||||
chkref=\$(grep -E 'SHA256.*dvd' /tmp/x | sed -e 's/.*= //') && echo "\$chkref $isoname" >/tmp/x
|
||||
sha256sum -c /tmp/x
|
||||
EOF
|
||||
assert_script_run($_) foreach (split /\n/, $cmd);
|
||||
}
|
||||
|
11
main.pm
11
main.pm
@ -356,6 +356,17 @@ elsif ((!get_var("START_AFTER_TEST") && !get_var("BOOTFROM")) || get_var("INSTAL
|
||||
# for now we can assume START_AFTER_TEST and BOOTFROM mean the
|
||||
# test picks up after an install, so we skip to post-install,
|
||||
# unless the override INSTALL var is set
|
||||
|
||||
if (get_var("PREINSTALL")) {
|
||||
# specified module supposed to first boot to rescue mode
|
||||
# do any required actions before to exit rescue mode (triggering reboot).
|
||||
# reboot will run through next normal install steps of load_install_tests.
|
||||
my @pis = split(/ /, get_var("PREINSTALL"));
|
||||
foreach my $pi (@pis) {
|
||||
autotest::loadtest "tests/${pi}.pm";
|
||||
}
|
||||
}
|
||||
|
||||
load_install_tests;
|
||||
}
|
||||
|
||||
|
22
needles/console/anaconda_rescue_shell_prompt.json
Normal file
22
needles/console/anaconda_rescue_shell_prompt.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 0,
|
||||
"ypos": 527,
|
||||
"width": 21,
|
||||
"height": 108,
|
||||
"type": "match"
|
||||
},
|
||||
{
|
||||
"xpos": 49,
|
||||
"ypos": 528,
|
||||
"width": 169,
|
||||
"height": 16,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"rescue_shell_prompt"
|
||||
]
|
||||
}
|
BIN
needles/console/anaconda_rescue_shell_prompt.png
Normal file
BIN
needles/console/anaconda_rescue_shell_prompt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
44
templates
44
templates
@ -710,6 +710,17 @@
|
||||
},
|
||||
test_suite => { name => "install_repository_nfs_graphical" },
|
||||
},
|
||||
{
|
||||
machine => { name => "64bit" },
|
||||
prio => 30,
|
||||
product => {
|
||||
arch => "x86_64",
|
||||
distri => "fedora",
|
||||
flavor => "Server-dvd-iso",
|
||||
version => "*",
|
||||
},
|
||||
test_suite => { name => "install_repository_hd_variation" },
|
||||
},
|
||||
{
|
||||
machine => { name => "64bit" },
|
||||
prio => 20,
|
||||
@ -2124,6 +2135,18 @@
|
||||
},
|
||||
test_suite => { name => "install_repository_nfs_graphical" },
|
||||
},
|
||||
{
|
||||
group_name => "Fedora PowerPC",
|
||||
machine => { name => "ppc64le" },
|
||||
prio => 30,
|
||||
product => {
|
||||
arch => "ppc64le",
|
||||
distri => "fedora",
|
||||
flavor => "Server-dvd-iso",
|
||||
version => "*",
|
||||
},
|
||||
test_suite => { name => "install_repository_hd_variation" },
|
||||
},
|
||||
{
|
||||
group_name => "Fedora PowerPC",
|
||||
machine => { name => "ppc64le" },
|
||||
@ -3744,6 +3767,18 @@
|
||||
},
|
||||
test_suite => { name => "install_repository_nfs_graphical" },
|
||||
},
|
||||
{
|
||||
group_name => "Fedora AArch64",
|
||||
machine => { name => "aarch64" },
|
||||
prio => 30,
|
||||
product => {
|
||||
arch => "aarch64",
|
||||
distri => "fedora",
|
||||
flavor => "Server-dvd-iso",
|
||||
version => "*",
|
||||
},
|
||||
test_suite => { name => "install_repository_hd_variation" },
|
||||
},
|
||||
{
|
||||
group_name => "Fedora AArch64",
|
||||
machine => { name => "aarch64" },
|
||||
@ -4941,6 +4976,15 @@
|
||||
{ key => "WORKER_CLASS", value => "tap" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name => "install_repository_hd_variation",
|
||||
settings => [
|
||||
{ key => "PREINSTALL", value => "preinstall_iso_in_hd" },
|
||||
{ key => "REPOSITORY_VARIATION", value => "hd:vdb1:/fedora_image.iso;" },
|
||||
{ key => "NUMDISKS", value => "2" },
|
||||
{ key => "HDD_2", value => "disk_full_mbr.img" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name => "install_delete_partial",
|
||||
settings => [
|
||||
|
@ -31,7 +31,10 @@ sub run {
|
||||
assert_script_run 'grep "enabled repo.*nfs" /tmp/packaging.log';
|
||||
}
|
||||
}
|
||||
if ($repourl =~ s/^nfs://) {
|
||||
if ($repourl =~ /^hd:/) {
|
||||
assert_script_run "mount |grep 'fedora_image.iso'";
|
||||
}
|
||||
elsif ($repourl =~ s/^nfs://) {
|
||||
$repourl =~ s/^nfsvers=.://;
|
||||
# the above both checks if we're dealing with an NFS URL, and
|
||||
# strips the 'nfs:' and 'nfsvers=.:' from it if so
|
||||
|
26
tests/preinstall_iso_in_hd.pm
Normal file
26
tests/preinstall_iso_in_hd.pm
Normal file
@ -0,0 +1,26 @@
|
||||
use base "anacondatest";
|
||||
use strict;
|
||||
use testapi;
|
||||
use utils;
|
||||
|
||||
sub run {
|
||||
select_rescue_mode;
|
||||
# select rescue shell and expect shell prompt
|
||||
type_string "3\n";
|
||||
send_key "ret";
|
||||
assert_screen "rescue_shell_prompt", 5; # should be shell prompt
|
||||
assert_script_run "fdisk -l | head -n20";
|
||||
assert_script_run "mkdir -p /hd";
|
||||
assert_script_run "mount /dev/vdb1 /hd";
|
||||
copy_devcdrom_as_isofile('/hd/fedora_image.iso');
|
||||
assert_script_run "umount /hd";
|
||||
type_string "exit\n"; # leave rescue mode.
|
||||
}
|
||||
|
||||
sub test_flags {
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
Loading…
Reference in New Issue
Block a user