From d012d3127044ff4109cd49ac264a5cf919ab894d Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 14 Dec 2022 08:47:46 -0800 Subject: [PATCH] _post_fail_hook: only do advisory package checks when appropriate Same conditions as used in main.pm to load the tests in the normal flow. It makes no sense to do this on non-update tests, or on the non-matching support server case. Signed-off-by: Adam Williamson --- lib/installedtest.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 1702bd4b..484201bf 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -159,10 +159,14 @@ sub post_fail_hook { upload_logs "/var/tmp/imgbuild/program.log", failok => 1; } - # For update tests, let's do the update package info log stuff, - # it may be useful for diagnosing the cause of the failure - advisory_get_installed_packages; - advisory_check_nonmatching_packages(fatal => 0); + if (get_var("ADVISORY_OR_TASK") && get_var("TEST") ne "install_default_update_netinst") { + unless (get_var("TEST") eq "support_server" && get_var("VERSION") ne get_var("CURRREL")) { + # For update tests, let's do the update package info log stuff, + # it may be useful for diagnosing the cause of the failure + advisory_get_installed_packages; + advisory_check_nonmatching_packages(fatal => 0); + } + } }