From b1e46166ecbbd0fd2ffa67e5443bdf7c537a677d Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 30 Apr 2023 11:28:06 -0700 Subject: [PATCH] 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); }