fix any_errors_fatal tests (#83389)

* fix any_errors_fatal test to exit on non-zero rc

Use a typo in the debug msg to avoid matching play recap

* remove duplicate 'set -ux'
pull/83404/head
Sloane Hertel 4 months ago committed by GitHub
parent 70c2b35210
commit 68638f4710
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,7 +11,7 @@
rescue:
- name: Rescues both hosts
debug:
msg: rescue
msg: rescuedd
- name: You can recover from fatal errors by adding a rescue section to the block.
debug:
msg: recovered

@ -15,8 +15,6 @@ if [ "${res}" -eq 0 ] ; then
exit 1
fi
set -ux
ansible-playbook -i inventory "$@" always_block.yml | tee out.txt | grep 'any_errors_fatal_always_block_start'
res=$?
cat out.txt
@ -25,8 +23,6 @@ if [ "${res}" -ne 0 ] ; then
exit 1
fi
set -ux
for test_name in test_include_role test_include_tasks; do
ansible-playbook -i inventory "$@" -e test_name=$test_name 50897.yml | tee out.txt | grep 'any_errors_fatal_this_should_never_be_reached'
res=$?
@ -36,6 +32,8 @@ for test_name in test_include_role test_include_tasks; do
fi
done
set -e
ansible-playbook -i inventory "$@" 31543.yml | tee out.txt
[ "$(grep -c 'SHOULD NOT HAPPEN' out.txt)" -eq 0 ]
@ -47,5 +45,5 @@ ansible-playbook -i inventory "$@" 73246.yml | tee out.txt
ansible-playbook -i inventory "$@" 80981.yml | tee out.txt
[ "$(grep -c 'SHOULD NOT HAPPEN' out.txt)" -eq 0 ]
[ "$(grep -c 'rescue' out.txt)" -eq 2 ]
[ "$(grep -c 'rescuedd' out.txt)" -eq 2 ]
[ "$(grep -c 'recovered' out.txt)" -eq 2 ]

Loading…
Cancel
Save