Skip to content

Commit

Permalink
Pre-install foreman-selinux in acceptance environment
Browse files Browse the repository at this point in the history
Also do not purge foreman-selinux between tests. This is a workaround
for the Puppet issue [PUP-10548].
  • Loading branch information
wbclark committed Apr 22, 2022
1 parent 1b5eec2 commit c7fbee0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
}

# Needed for idempotency when SELinux is enabled
if $foreman::repo::configure_scl_repo {
package { 'rh-redis5-redis':
ensure => installed,
if $facts['os']['selinux']['enabled'] {
package { 'foreman-selinux':
ensure => latest,
require => Class['foreman::repo'],
}

if $foreman::repo::configure_scl_repo {
package { 'rh-redis5-redis':
ensure => installed,
require => Class['foreman::repo'],
}
}
}

# Not /etc/foreman because purging removes that
Expand Down
2 changes: 1 addition & 1 deletion spec/support/acceptance/purge.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def purge_foreman
case fact('osfamily')
when 'RedHat'
on default, 'yum -y remove foreman* tfm-*'
on default, 'rpm -qa | grep -P \'^tfm|^foreman(?!-selinux)\' | xargs yum -y remove'
when 'Debian'
on default, 'apt-get purge -y foreman*', { :acceptable_exit_codes => [0, 100] }
on default, 'apt-get purge -y ruby-hammer-cli-*', { :acceptable_exit_codes => [0, 100] }
Expand Down

0 comments on commit c7fbee0

Please sign in to comment.