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/lib/packagetest.pm b/lib/packagetest.pm index ae4cc525..ad17bacc 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'; + 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'; + 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/_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 { 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); } diff --git a/tests/base_update_cli.pm b/tests/base_update_cli.pm index 314dd419..dd832663 100644 --- a/tests/base_update_cli.pm +++ b/tests/base_update_cli.pm @@ -11,16 +11,20 @@ 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) + 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 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 {