Skip to content

Commit

Permalink
Add a test for disabling puppet
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Mar 27, 2023
1 parent 2b3ffc4 commit 9aa94c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bats/fb-test-puppet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,14 @@ fi
puppet agent -v -o --no-daemonize
grep -i "property of the Foreman project" /etc/motd
}

@test "disable puppet" {
KATELLO_VERSION=$(tKatelloVersion)
if [[ $KATELLO_VERSION != 4.[3-9]* ]]; then
skip "Disabling Puppet explicitly is only supported with Katello 4.2 or older"
fi

if tForemanMaintainCommandAvailable 'plugin purge-puppet'; then
foreman-maintain plugin purge-puppet
fi
}
8 changes: 8 additions & 0 deletions bats/foreman_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,11 @@ tWaitForTask() {
sleep $(( next_wait_time++ ))
done
}

tForemanMaintainCommandAvailable() {
if tForemanMaintainAvailable ; then
if ! foreman-maintain $1 --help ; then
skip "foreman-maintain $1 is not available"
fi
fi
}

0 comments on commit 9aa94c3

Please sign in to comment.