FEATURE: Add DNF_CONTENTDIR override support #119

Merged
tcooper merged 14 commits from issue_118 into 9.0_release_fixes 2022-07-10 21:05:04 +00:00
3 changed files with 53 additions and 0 deletions
Showing only changes of commit eb5de332cc - Show all commits

View File

@ -291,6 +291,11 @@ sub load_postinstall_tests() {
# load the early tests # load the early tests
_load_early_postinstall_tests(); _load_early_postinstall_tests();
## enable staging repos if requested
if (get_var("DNF_CONTENTDIR")) {
autotest::loadtest "tests/_staging_repos_enable.pm";
}
# do standard post-install static network config if the var is set # do standard post-install static network config if the var is set
# and this is not an upgrade test (this is done elsewhere in the # and this is not an upgrade test (this is done elsewhere in the
# upgrade workflow) # upgrade workflow)

View File

@ -0,0 +1,23 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
$self->root_console(tty=>4);
# Point at default repositories by modifying contentdir
# NOTE: This will leave repos pointing at primary dl server instead
# of mirrorlist.
script_run 'printf "pub/rocky\n" > /etc/dnf/vars/contentdir';
script_run 'dnf clean all';
script_run 'dnf repoinfo'
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,25 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
$self->root_console(tty=>4);
# Point at staging repositories by modifying contentdir
if (get_version_major() < 9) {
script_run "sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/Rocky-*";
script_run "sed -i 's,^#\(baseurl=http[s]*://\),\1,g' /etc/yum.repos.d/Rocky-*";
}
script_run 'printf "stg/rocky\n" > /etc/dnf/vars/contentdir';
script_run 'dnf clean all';
script_run 'dnf repoinfo';
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: