2016-10-12 23:57:53 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -ux
|
|
|
|
|
|
|
|
# ensure fail/assert work locally and can stop execution with non-zero exit code
|
|
|
|
PB_OUT=$(ansible-playbook -i inventory.local test_test_infra.yml)
|
|
|
|
APB_RC=$?
|
|
|
|
echo "$PB_OUT"
|
|
|
|
echo "rc was $APB_RC (must be non-zero)"
|
2017-10-17 18:37:05 +02:00
|
|
|
[ ${APB_RC} -ne 0 ]
|
2016-10-12 23:57:53 +02:00
|
|
|
echo "ensure playbook output shows assert/fail works (True)"
|
|
|
|
echo "$PB_OUT" | grep -F "fail works (True)" || exit 1
|
|
|
|
echo "$PB_OUT" | grep -F "assert works (True)" || exit 1
|
|
|
|
|
|
|
|
# ensure we work using all specified test args, overridden inventory, etc
|
|
|
|
PB_OUT=$(ansible-playbook -i ../../inventory test_test_infra.yml "$@")
|
|
|
|
APB_RC=$?
|
|
|
|
echo "$PB_OUT"
|
|
|
|
echo "rc was $APB_RC (must be non-zero)"
|
2017-10-17 18:37:05 +02:00
|
|
|
[ ${APB_RC} -ne 0 ]
|
2016-10-12 23:57:53 +02:00
|
|
|
echo "ensure playbook output shows assert/fail works (True)"
|
|
|
|
echo "$PB_OUT" | grep -F "fail works (True)" || exit 1
|
|
|
|
echo "$PB_OUT" | grep -F "assert works (True)" || exit 1
|