From 12fa93bd2766ba3acab6af8ac0b7ace82525a0c7 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 10 Jun 2023 16:00:21 -0700 Subject: [PATCH] Tweak ostree build and rebase for update tests to be more robust We have had several problems where rebasing from one release to another just doesn't work, and we have to work around it somehow. Sometimes it's difficult or impossible to do. All we want to do here is check the rebase mechanism itself; we don't actually want to assert that you can rebase to any specific other release. For update tests, we should be able to use a non-standard ref name for the ostree we build, embed into the installer image, and install. That should mean we can then rebase to the standard ref name for the same release, which should be much safer than trying to rebase to a different release. We can't do this for the compose tests, but at least for update tests I'm hoping this makes things more robust. Signed-off-by: Adam Williamson --- ostree-parse-pungi.py | 3 +++ tests/_ostree_build.pm | 5 ++++- tests/rpmostree_rebase.pm | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ostree-parse-pungi.py b/ostree-parse-pungi.py index 45b8e035..6781d45b 100644 --- a/ostree-parse-pungi.py +++ b/ostree-parse-pungi.py @@ -44,5 +44,8 @@ for addtempvar in args["add_template_var"]: # this is where the previous step of the openQA test created the # ostree repo cmd = cmd.replace("https://kojipkgs.fedoraproject.org/compose/ostree/repo/", "file:///var/tmp/ostree/repo") +# this changes to our custom ref name +cmd = cmd.replace("ostree_install_ref=fedora/", "ostree_install_ref=fedora-openqa/") +cmd = cmd.replace("ostree_update_ref=fedora/", "ostree_update_ref=fedora-openqa/") print(cmd) diff --git a/tests/_ostree_build.pm b/tests/_ostree_build.pm index 73ef6e54..f68e8e7d 100644 --- a/tests/_ostree_build.pm +++ b/tests/_ostree_build.pm @@ -46,6 +46,9 @@ sub run { my $repl = 'repos:\n - advisory\n - workarounds'; $repl .= '\n - koji-rawhide' if ($version eq $rawrel); assert_script_run 'sed -i -e "s,repos:,' . $repl . ',g" fedora-' . $lcsubv . '.yaml'; + # change the ref name to a custom one (so we can test rebasing to + # the 'normal' ref later) + assert_script_run 'sed -i -e "s,ref: fedora/,ref: fedora-openqa/,g" fedora-' . $lcsubv . '.yaml'; # upload the config so we can check it upload_logs "fedora-$lcsubv.yaml"; assert_script_run 'popd'; @@ -74,7 +77,7 @@ sub run { assert_script_run 'git clone https://pagure.io/pungi-fedora.git'; assert_script_run 'cd pungi-fedora/'; assert_script_run "git checkout ${branch}"; - assert_script_run 'wget https://pagure.io/fedora-qa/os-autoinst-distri-fedora/raw/main/f/ostree-parse-pungi.py', timeout => 120; + assert_script_run 'wget https://pagure.io/fedora-qa/os-autoinst-distri-fedora/raw/ostree-custom-ref/f/ostree-parse-pungi.py', timeout => 120; my $loraxargs = script_output "python3 ostree-parse-pungi.py $lcsubv $arch"; # this 'temporary file cleanup' thing can actually wipe bits of diff --git a/tests/rpmostree_rebase.pm b/tests/rpmostree_rebase.pm index d3242a9e..2ecc6f0b 100644 --- a/tests/rpmostree_rebase.pm +++ b/tests/rpmostree_rebase.pm @@ -38,7 +38,12 @@ sub run { $rebase = $relnum - 1; # avoid rebasing from 37 to <37, bad stuff happens # FIXME when 38 branches, we should change this to RELNUM+1 - $rebase = "rawhide" if ($relnum eq "37"); + $rebase = "38" if ($relnum eq "37"); + # on update tests, just rebase to the 'official' ref for the + # release, as opposed to the custom ref we used when building; + # this should be more reliable than a different release + $rebase = $relnum if (get_var("ADVISORY_OR_TASK")); + $rebase = "rawhide" if ($rebase eq get_var("RAWREL")); $target = "fedora/${rebase}/${arch}/silverblue"; } elsif ($current =~ "coreos") {