From c9ee065c8f81a687496c8f99ad983d983de5a8c6 Mon Sep 17 00:00:00 2001 From: AlanMarshall Date: Mon, 27 Mar 2023 11:39:25 +0100 Subject: [PATCH 1/6] Modifies serial console install following change in network enable default from v8 to v9 --- tests/_boot_to_anaconda.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 297d6f96..70f19efa 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -99,8 +99,11 @@ sub run { # we direct the installer to virtio-console1, and use # virtio-console as a root console select_console('virtio-console1'); - unless (wait_serial "Use text mode", timeout => 120) { die "Anaconda has not started."; } - type_string "2\n"; + if (get_var("DISTRI") eq "rocky" && (get_version_major() > 8)) { + unless (wait_serial "Use text mode", timeout => 120) { die "Anaconda has not started."; } + type_string "2\n"; + } + # see comment below unless (wait_serial "Installation") { die "Text version of Anaconda has not started."; } } else { From f3e92d20c11a2d9b2cedc98f48d1aa9c82bcfc3d Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 18 Mar 2023 16:44:02 +0000 Subject: [PATCH 2/6] Use pandoc-common instead of python3-kickstart for package tests Reasoning: 1. pandoc is not in critpath so will not itself be tested 2. pandoc is widely used and actively maintained 3. package is noarch 4. package has minimal deps Hopefully this will work for everything. For some reason, the "use python3-blivet for pykickstart tests" fails mysteriously sometimes, see e.g. https://openqa.stg.fedoraproject.org/tests/2672282 Signed-off-by: Adam Williamson Signed-off-by: Trevor Cooper --- lib/packagetest.pm | 20 ++++++++++---------- tests/base_update_cli.pm | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/packagetest.pm b/lib/packagetest.pm index ae4cc525..f5fce1e9 100644 --- a/lib/packagetest.pm +++ b/lib/packagetest.pm @@ -9,15 +9,15 @@ use testapi; our @EXPORT = qw/prepare_test_packages verify_installed_packages verify_updated_packages/; # enable the openqa test package repositories and install the main -# test packages, remove python3-kickstart and install the fake one +# test packages, remove pandoc-common and install the fake one sub prepare_test_packages { - # remove python3-kickstart if installed (we don't use assert + # remove pandoc-common if installed (we don't use assert # here in case it's not) - script_run 'dnf -y remove python3-kickstart', 180; + script_run 'dnf -y remove pandoc-common', 180; # grab the test repo definitions assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://fedorapeople.org/groups/qa/openqa-repos/openqa-testrepo-1.repo'; # install the test packages from repo1 - assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install python3-kickstart'; + assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install pandoc-common'; if (get_var("DESKTOP") eq 'kde' && get_var("TEST") eq 'desktop_update_graphical') { # kick pkcon so our special update will definitely get installed assert_script_run 'pkcon refresh force'; @@ -27,15 +27,15 @@ sub prepare_test_packages { # check our test packages installed correctly (this is a test that dnf # actually does what it claims) sub verify_installed_packages { - validate_script_output 'rpm -q python3-kickstart', sub { $_ =~ m/^python3-kickstart-1.1.noarch$/ }; - assert_script_run 'rpm -V python3-kickstart'; + validate_script_output 'rpm -q pandoc-common', sub { $_ =~ m/^pandoc-common-1.1.noarch$/ }; + assert_script_run 'rpm -V pandoc-common'; } -# check updating the test packages and the fake python3-kickstart work +# check updating the test packages and the fake pandoc-common work # as expected sub verify_updated_packages { - # we don't know what version of python3-kickstart we'll actually + # we don't know what version of pandoc-common we'll actually # get, so just check it's *not* the fake one - validate_script_output 'rpm -q python3-kickstart', sub { $_ !~ m/^python3-kickstart-1-1.noarch$/ }; - assert_script_run 'rpm -V python3-kickstart'; + validate_script_output 'rpm -q pandoc-common', sub { $_ !~ m/^pandoc-common-1-1.noarch$/ }; + assert_script_run 'rpm -V pandoc-common'; } diff --git a/tests/base_update_cli.pm b/tests/base_update_cli.pm index 314dd419..b37599b7 100644 --- a/tests/base_update_cli.pm +++ b/tests/base_update_cli.pm @@ -11,16 +11,16 @@ sub run { prepare_test_packages; # check rpm agrees they installed good verify_installed_packages; - # update the fake python3-kickstart (should come from the real repo) + # update the fake pandoc-common (should come from the real repo) # this can take a long time if we get unlucky with the metadata refresh - assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update python3-kickstart', 600; + assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update pandoc-common', 600; # check we got the updated version verify_updated_packages; - # now remove python3-kickstart, and see if we can do a straight + # now remove pandoc-common, and see if we can do a straight # install from the default repos - assert_script_run 'dnf -y remove python3-kickstart'; - assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing install python3-kickstart', 120; - assert_script_run 'rpm -V python3-kickstart'; + assert_script_run 'dnf -y remove pandoc-common'; + assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing install pandoc-common', 120; + assert_script_run 'rpm -V pandoc-common'; } sub test_flags { From c185b5d074001e408c54d1600442555325485765 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sat, 29 Apr 2023 10:36:08 -0700 Subject: [PATCH 3/6] pandoc-common is in powertools --- tests/base_update_cli.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/base_update_cli.pm b/tests/base_update_cli.pm index b37599b7..242bcd8e 100644 --- a/tests/base_update_cli.pm +++ b/tests/base_update_cli.pm @@ -14,6 +14,10 @@ sub run { # update the fake pandoc-common (should come from the real repo) # this can take a long time if we get unlucky with the metadata refresh assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update pandoc-common', 600; + if (get_var("DISTRI") eq "rocky") { + # pandoc-common is in PowerTools in RockyLinux + assert_script_run 'dnf config-manager --set-enabled powertools', 60; + } # check we got the updated version verify_updated_packages; # now remove pandoc-common, and see if we can do a straight From 8106d07b6cfa67a8a2d9976e01f54702bb3399c1 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sat, 29 Apr 2023 10:41:51 -0700 Subject: [PATCH 4/6] correct order for enable powertools --- tests/base_update_cli.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/base_update_cli.pm b/tests/base_update_cli.pm index 242bcd8e..dd832663 100644 --- a/tests/base_update_cli.pm +++ b/tests/base_update_cli.pm @@ -11,13 +11,13 @@ sub run { prepare_test_packages; # check rpm agrees they installed good verify_installed_packages; - # update the fake pandoc-common (should come from the real repo) - # this can take a long time if we get unlucky with the metadata refresh - assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update pandoc-common', 600; if (get_var("DISTRI") eq "rocky") { # pandoc-common is in PowerTools in RockyLinux assert_script_run 'dnf config-manager --set-enabled powertools', 60; } + # update the fake pandoc-common (should come from the real repo) + # this can take a long time if we get unlucky with the metadata refresh + assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update pandoc-common', 600; # check we got the updated version verify_updated_packages; # now remove pandoc-common, and see if we can do a straight From a947177135ac0af0e410af1ada6cb85427ff8429 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 30 Apr 2023 11:25:39 -0700 Subject: [PATCH 5/6] use Rocky Linux controlled openqa-testrepo-1 --- lib/packagetest.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/packagetest.pm b/lib/packagetest.pm index ae4cc525..f4a9b436 100644 --- a/lib/packagetest.pm +++ b/lib/packagetest.pm @@ -15,7 +15,7 @@ sub prepare_test_packages { # here in case it's not) script_run 'dnf -y remove python3-kickstart', 180; # grab the test repo definitions - assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://fedorapeople.org/groups/qa/openqa-repos/openqa-testrepo-1.repo'; + assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://git.resf.org/testing/openqa-testrepos/raw/branch/main/openqa-testrepo-1.repo'; # install the test packages from repo1 assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install python3-kickstart'; if (get_var("DESKTOP") eq 'kde' && get_var("TEST") eq 'desktop_update_graphical') { From b1e46166ecbbd0fd2ffa67e5443bdf7c537a677d Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 30 Apr 2023 11:28:06 -0700 Subject: [PATCH 6/6] add support to specify dnf releasever during POST --- VARIABLES.md | 4 +++- tests/_do_install_and_reboot.pm | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VARIABLES.md b/VARIABLES.md index 2018c548..948e5df4 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -99,7 +99,7 @@ These variables should be set when tests are scheduled (when running `isos post` | `KOJITASK` | A Koji task ID. If set, the modified 'update testing' flow for testing scratch builds will be used: post-install tests will be run with the packages from the update, starting from the stable release base disk images | | `DISTRI` | contains distribution name (should be same as in WebUI, probably `rocky`) | | `VERSION` | contains version of distribution | -| `FLAVOR` | indicates what type of distribution is used. Three Pungi properties, joined with `-`: `variant`, `type`, and `format`. e.g.: `Server-dvd-iso`. Special value `universal` is used to schedule the group of tests that should be run once each per arch per compose, against the 'best' available ISO | +| `FLAVOR` | indicates what type of distribution is used. Three Pungi properties, joined with `-`: `variant`, `type`, and `format`. e.g.: `dvd-iso`. Special value `universal` is used to schedule the group of tests that should be run once each per arch per compose, against the 'best' available ISO | | `ARCH` | is set to architecture that will be used (`x86_64`, `i686`) | | `BUILD` | contains Pungi compose_id (something like `Rocky-8.4-20210801.n.0`) | | `LABEL` | contains Pungi compose label, if it has one (otherwise should be unset) - e.g `RC-1.5` | @@ -108,3 +108,5 @@ These variables should be set when tests are scheduled (when running `isos post` | `UP1REL` | the source release for "1-release" upgrade tests (usually but not always same as `CURRREL`) | | `UP2REL` | the source release for "2-release" upgrade tests (currently always same as `PREVREL`) | | `LOCATION` | contains Pungi base compose location (something like `https://kojipkgs.rockylinux.org/compose/branched/Rocky-8.4-20210801.n.0/compose/`) | +| `DNF_CONTENTDIR` | the value to change `/etc/dnf/vars/contentdir` to (eg. `stg/rocky`) allowing repository reconfiguration to point at staging (usually but not always used with `DNF_RELEASEVER`) | +| `DNF_RELEASEVER` | the value to change `/etc/dnf/vars/releasever` to (eg. `8.8-Beta`) allowing repository reconfiguration to point at a specific release (usually but not always used with `DNF_CONTENTDIR`) | diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index a4a66212..3559b9ff 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -141,6 +141,7 @@ sub run { push(@actions, 'abrt') if (get_var("ABRT", '') eq "system"); push(@actions, 'rootpw') if (get_var("INSTALLER_NO_ROOT")); push(@actions, 'stagingrepos') if (get_var("DNF_CONTENTDIR")); + push(@actions, 'releasever') if (get_var("DNF_RELEASEVER")); # memcheck test doesn't need to reboot at all. Rebooting from GUI # for lives is unreliable. And if we're already doing something # else at a console, we may as well reboot from there too @@ -202,6 +203,9 @@ sub run { } assert_script_run 'printf "stg/rocky\n" > ' . $mount . '/etc/dnf/vars/contentdir'; } + if (grep { $_ eq 'releasever' } @actions) { + assert_script_run 'printf "%s\n" "' . get_var("DNF_RELEASEVER") . '" > ' . $mount . '/etc/dnf/vars/releasever'; + } type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions); }