Skip to content

Commit

Permalink
Merge pull request #20207 from rbmarliere/yum2dnf
Browse files Browse the repository at this point in the history
containers: Use 'dnf' instead of 'yum'
  • Loading branch information
rbmarliere authored Sep 17, 2024
2 parents 48685c3 + 4be871f commit cef2f4b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/containers/common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sub install_podman_when_needed {
my @pkgs = qw(podman);
if (script_run("which podman") != 0) {
if ($host_os =~ /centos|rhel/) {
script_retry "yum -y install @pkgs --nobest --allowerasing", timeout => 300;
script_retry "dnf -y install @pkgs --nobest --allowerasing", timeout => 300;
} elsif ($host_os eq 'ubuntu') {
script_retry("apt-get -y install @pkgs", timeout => 300);
} else {
Expand Down Expand Up @@ -130,8 +130,8 @@ sub install_buildah_when_needed {
script_retry("apt-get update", timeout => 900);
script_retry("apt-get -y install buildah", timeout => 300);
} elsif ($host_os eq 'rhel') {
script_retry('yum update -y', timeout => 300);
script_retry('yum install -y buildah', timeout => 300);
script_retry('dnf update -y', timeout => 300);
script_retry('dnf install -y buildah', timeout => 300);
} else {
activate_containers_module if $host_os =~ 'sle';
zypper_call('in buildah', timeout => 300);
Expand Down
2 changes: 1 addition & 1 deletion tests/containers/bci_prepare.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ sub run {
assert_script_run("pip3 --quiet install tox", timeout => 600);
} elsif ($host_distri =~ /centos|rhel/) {
foreach my $pkg (@packages) {
script_retry("yum install -y $pkg", timeout => 300);
script_retry("dnf install -y $pkg", timeout => 300);
}
activate_virtual_env if ($bci_virtualenv);
assert_script_run('pip3 --quiet install --upgrade pip', timeout => 600);
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/host_configuration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ sub run {
script_retry("apt-get update -qq -y", timeout => $update_timeout);
} elsif ($host_distri eq 'centos') {
assert_script_run("dhclient -v");
script_retry("yum update -q -y --nobest", timeout => $update_timeout);
script_retry("dnf update -q -y --nobest", timeout => $update_timeout);
} elsif ($host_distri eq 'rhel') {
script_retry("yum update -q -y", timeout => $update_timeout);
script_retry("dnf update -q -y", timeout => $update_timeout);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/containers/install_updates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ sub run {
script_retry("apt-get update -qq -y", timeout => $update_timeout);
} elsif ($host_distri eq 'centos') {
assert_script_run("dhclient -v");
script_retry("yum update -q -y --nobest", timeout => $update_timeout);
script_retry("dnf update -q -y --nobest", timeout => $update_timeout);
} elsif ($host_distri eq 'rhel') {
script_retry("yum update -q -y", timeout => $update_timeout);
script_retry("dnf update -q -y", timeout => $update_timeout);
} else {
die "Unsupported OS version";
}
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/update_host.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ sub run {
script_retry("apt-get update -y", timeout => $update_timeout);
} elsif ($host_distri eq 'centos') {
assert_script_run("dhclient -v");
script_retry("yum update -y --nobest", timeout => $update_timeout);
script_retry("dnf update -y --nobest", timeout => $update_timeout);
} elsif ($host_distri eq 'rhel') {
script_retry("yum update -y", timeout => $update_timeout);
script_retry("dnf update -y", timeout => $update_timeout);
$self->disable_selinux();
} else {
die("Host OS not supported");
Expand Down

0 comments on commit cef2f4b

Please sign in to comment.