Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 7.x] Fix tests on Red Hat 9 #9524

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions acceptance/lib/puppet/acceptance/rpm_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ module RpmUtils

def rpm_provider(agent)
has_dnf = on(agent, 'which dnf', :acceptable_exit_codes => [0,1]).exit_code
if has_dnf == 0
'dnf'
else
'yum'
end
has_dnf == 0 ? 'dnf' : 'yum'
end

def setup(agent)
@@setup_packages[agent] ||= {}
cmd = rpm_provider(agent)
required_packages = ['createrepo', 'curl', 'rpm-build']
required_packages = %w[createrepo curl rpm-build]
required_packages.each do |pkg|
pkg_installed = (on agent, "#{cmd} list installed #{pkg}", :acceptable_exit_codes => (0..255)).exit_code == 0
# We need a newer OpenSSH for the newer OpenSSL that curl installs
# RE-16677
on(agent, 'dnf upgrade -y openssh') if (agent.platform.start_with?('el-9') && pkg == 'curl')
# package not present, so perform a new install
if !pkg_installed
on agent, "#{cmd} install -y #{pkg}"
Expand Down
Loading