From b8fddfa2658c71457f20b92739e80d9a748efbca Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 13 Mar 2024 10:17:44 -0700 Subject: [PATCH] Fix the logic for skipping _repo_setup_updates Just checking for the package update list is wrong in a couple of ways: 1. It goes wrong for child tests that inherit the main disk from the parent test, but not the second disk where the actual update repo lives. They'll have the package list, but not the repo. So we should test for both the package list and the repo dir. 2. It goes wrong for side tag tests, because we don't write a package list (or create an update repo) on that path. So on that path let's check whether we already created the repo definition we use on that path. Signed-off-by: Adam Williamson --- lib/utils.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 2e62fe27..92674628 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -633,12 +633,20 @@ sub setup_repos { sub _repo_setup_updates { # Appropriate repo setup steps for testing a Bodhi update + my $tag = get_var("TAG"); # Check if we already ran, bail if so - return unless script_run "test -f /mnt/updatepkgs.txt"; + if ($tag) { + # for TAG case, check for the repo file + return unless script_run "test -f /etc/yum.repos.d/openqa-testtag.repo"; + } + else { + # otherwise, run unless both the update repo and the update + # package list are present already + return unless (script_run "test -d /mnt/update_repo/repodata && test -f /mnt/updatepkgs.txt"); + } my $version = get_var("VERSION"); my $currrel = get_var("CURRREL", "0"); my $arch = get_var("ARCH"); - my $tag = get_var("TAG"); # this can be used for debugging repo config if something is wrong # unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') { # upload_logs "/etc/yum.repos.d/yumreposd.tar.gz";