Skip to content

Commit

Permalink
Ensure lsb-release is present on Debian upgrade tests
Browse files Browse the repository at this point in the history
Facter 4 has can derive os.distro.codename from /etc/os-release but
Facter 3 needs lsb-release to be present.

It also moves the unsupported_puppetserver definition to use the release
major instead of the codename to avoid needing lsb-release.
  • Loading branch information
ekohl committed Feb 4, 2022
1 parent 3c729c8 commit 69bbe88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions spec/acceptance/puppetserver_upgrade_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@

case fact('osfamily')
when 'Debian'
from_version_exact = "#{from_version}-1#{fact('lsbdistcodename')}"
to_version_exact = "#{to_version}-1#{fact('lsbdistcodename')}"
if ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet6'
# Facter 3 needs lsb-release for the os.distro.codename fact
on default, puppet('resource package lsb-release ensure=installed')
end
from_version_exact = "#{from_version}-1#{fact('os.distro.codename')}"
to_version_exact = "#{to_version}-1#{fact('os.distro.codename')}"
else
from_version_exact = from_version
to_version_exact = to_version
Expand Down
2 changes: 1 addition & 1 deletion spec/support/acceptance/puppetserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ def unsupported_puppetserver
when 'Fedora'
true
when 'Ubuntu'
ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet6' && host_inventory['facter']['os']['distro']['codename'] == 'focal'
ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet6' && host_inventory['facter']['os']['release']['major'] == '20.04'
end
end

0 comments on commit 69bbe88

Please sign in to comment.