FEATURE: Add DNF_CONTENTDIR
override support
#119
5
main.pm
5
main.pm
@ -291,6 +291,11 @@ sub load_postinstall_tests() {
|
||||
# load the early 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
|
||||
# and this is not an upgrade test (this is done elsewhere in the
|
||||
# upgrade workflow)
|
||||
|
23
tests/_staging_repos_disable.pm
Normal file
23
tests/_staging_repos_disable.pm
Normal 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:
|
25
tests/_staging_repos_enable.pm
Normal file
25
tests/_staging_repos_enable.pm
Normal 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:
|
Loading…
Reference in New Issue
Block a user