Fix up the 'skip update on support server' stuff (a20ea59)

The previous attempt at this (in a20ea59) was wrong, because it
meant we didn't create the update repo at all, and we do need
the repo to exist in the support_server test every time (as the
point of the support server is to serve it out via NFS). We just
don't want to *use it on the support_server system itself* if
the releases don't match. So rejig things to do that properly.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-02-08 08:20:24 -08:00
parent 99302c6fd4
commit f50f6d66b1
2 changed files with 16 additions and 14 deletions

View File

@ -413,13 +413,18 @@ sub _repo_setup_updates {
upload_logs "/var/log/updatepkgnames.txt"; upload_logs "/var/log/updatepkgnames.txt";
# create the repo metadata # create the repo metadata
assert_script_run "createrepo ."; assert_script_run "createrepo .";
# write a repo config file # write a repo config file, unless this is the support_server test
assert_script_run 'printf "[advisory]\nname=Advisory repo\nbaseurl=file:///opt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0" > /etc/yum.repos.d/advisory.repo'; # and it is running on a different release than the update is for
# (in this case we need the repo to exist but do not want to use
# it on the actual support_server system)
unless (get_var("TEST") eq "support_server" && get_var("VERSION") ne get_var("CURRREL")) {
assert_script_run 'printf "[advisory]\nname=Advisory repo\nbaseurl=file:///opt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0" > /etc/yum.repos.d/advisory.repo';
# run an update now (except for upgrade tests)
script_run "dnf -y update", 600 unless (get_var("UPGRADE"));
}
# mark via a variable that we've set up the update/task repo and done # mark via a variable that we've set up the update/task repo and done
# all the logging stuff above # all the logging stuff above
set_var('_ADVISORY_REPO_DONE', '1'); set_var('_ADVISORY_REPO_DONE', '1');
# run an update now (except for upgrade tests)
script_run "dnf -y update", 600 unless (get_var("UPGRADE"));
} }
sub repo_setup { sub repo_setup {

17
main.pm
View File

@ -276,13 +276,9 @@ sub load_postinstall_tests() {
# are checking that an installer image built from the update works and do # are checking that an installer image built from the update works and do
# not install the update themselves in this manner # not install the update themselves in this manner
if (get_var("ADVISORY_OR_TASK") && !get_var("UPGRADE") && !get_var("INSTALL")) { if (get_var("ADVISORY_OR_TASK") && !get_var("UPGRADE") && !get_var("INSTALL")) {
# don't try and install updates on the support server unless the autotest::loadtest "tests/_advisory_update.pm";
# update is for the same release as the support server disk image # now load the early boot tests again, as _advisory_update reboots
if (get_var("TEST") ne "support_server" || get_var("VERSION") eq get_var("CURRREL")) { _load_early_postinstall_tests(2);
autotest::loadtest "tests/_advisory_update.pm";
# now load the early boot tests again, as _advisory_update reboots
_load_early_postinstall_tests(2);
}
} }
# from now on, we have fully installed and booted system with root/specified user logged in # from now on, we have fully installed and booted system with root/specified user logged in
@ -325,9 +321,10 @@ sub load_postinstall_tests() {
# do this for INSTALL test(s); these are checking that an installer image # do this for INSTALL test(s); these are checking that an installer image
# built from the update works and do not install the update themselves. # built from the update works and do not install the update themselves.
if (get_var("ADVISORY_OR_TASK") && !get_var("INSTALL")) { if (get_var("ADVISORY_OR_TASK") && !get_var("INSTALL")) {
# don't try and install updates on the support server unless the # don't do this for support server unless the update is for the same
# update is for the same release as the support server disk image # release as the support server disk image, as we don't install the
if (get_var("TEST") ne "support_server" || get_var("VERSION") eq get_var("CURRREL")) { # updates on support server when they differ
unless (get_var("TEST") eq "support_server" && get_var("VERSION") ne get_var("CURRREL")) {
autotest::loadtest "tests/_advisory_post.pm"; autotest::loadtest "tests/_advisory_post.pm";
} }
} }