From a49f328dc688ef9a247cb7730233da40d6785373 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 28 Sep 2018 14:21:28 -0700 Subject: [PATCH] Tweak how update-upgrade tests are handled a bit Looking at this, it's a bit weird: the updated packages are actually included in the upgrade process, but we still run _advisory_update, which does basically nothing...then reboots. That's kinda silly and makes the tests a bit flaky, let's fix it. I don't think there's actually any problem with doing the upload of updatepkgs.txt in _repo_setup_updates, becase that already guards against being run more than once, it just bails very early if it's already been run. Signed-off-by: Adam Williamson --- lib/utils.pm | 4 ++-- main.pm | 6 ++++-- tests/_advisory_update.pm | 4 ---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 3cdce8fd..c81bfd4b 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -436,9 +436,9 @@ sub _repo_setup_updates { # } # log the exact packages in the update at test time, with their - # source packages and epochs. log is uploaded by _advisory_update - # and used for later comparison by _advisory_post + # source packages and epochs assert_script_run 'rpm -qp *.rpm --qf "%{SOURCERPM} %{EPOCH} %{NAME}-%{VERSION}-%{RELEASE}\n" | sort -u > /var/log/updatepkgs.txt'; + upload_logs "/var/log/updatepkgs.txt"; # create the repo metadata assert_script_run "createrepo ."; # write a repo config file diff --git a/main.pm b/main.pm index 8a46462a..4e040d0e 100644 --- a/main.pm +++ b/main.pm @@ -269,8 +269,10 @@ sub load_postinstall_tests() { # if scheduler passed an advisory, update packages from that advisory # (intended for the updates testing workflow, so we install the updates - # to be tested) - if (get_var("ADVISORY")) { + # to be tested). Don't do this for UPGRADE tests, as the update gets + # installed as part of the upgrade in that case and we don't need the + # extra reboot. + if (get_var("ADVISORY") && !get_var("UPGRADE")) { autotest::loadtest "tests/_advisory_update.pm"; # now load the early boot tests again, as _advisory_update reboots _load_early_postinstall_tests(2); diff --git a/tests/_advisory_update.pm b/tests/_advisory_update.pm index 3c65d42c..af2787fa 100644 --- a/tests/_advisory_update.pm +++ b/tests/_advisory_update.pm @@ -9,10 +9,6 @@ sub run { # update packages and run 'dnf update' $self->root_console(tty=>3); repo_setup; - # upload the log of installed packages which repo_setup created - # we do this here and not in repo_setup because this is the best - # place to make sure it happens once and only once per job - upload_logs "/var/log/updatepkgs.txt"; # reboot, in case any of the updates need a reboot to apply script_run "reboot", 0; }