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

Add a test for disabling puppet #1664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 11 additions & 0 deletions bats/fb-test-puppet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,14 @@ fi
REPORT_ID=$(hammer --output csv --no-headers config-report list --fields "Id" --search "host=${HOSTNAME} origin=Puppet")
hammer config-report info --id "${REPORT_ID%%[[:space:]]*}" | grep "Resource: Puppet"
}

@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 @@ -145,3 +145,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
}
Loading