summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/any_errors_fatal
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2024-06-06 21:25:49 +0200
committerGitHub <noreply@github.com>2024-06-06 21:25:49 +0200
commit68638f47109c555812bd1a70477f995ebe8f1d21 (patch)
tree7233a73df811cef741d6c24be462f83812f8466f /test/integration/targets/any_errors_fatal
parentdocs adjustments (batch 2) (#83368) (diff)
downloadansible-68638f47109c555812bd1a70477f995ebe8f1d21.tar.xz
ansible-68638f47109c555812bd1a70477f995ebe8f1d21.zip
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'
Diffstat (limited to 'test/integration/targets/any_errors_fatal')
-rw-r--r--test/integration/targets/any_errors_fatal/80981.yml2
-rwxr-xr-xtest/integration/targets/any_errors_fatal/runme.sh8
2 files changed, 4 insertions, 6 deletions
diff --git a/test/integration/targets/any_errors_fatal/80981.yml b/test/integration/targets/any_errors_fatal/80981.yml
index 51cf8dfe14..5654aa1a6a 100644
--- a/test/integration/targets/any_errors_fatal/80981.yml
+++ b/test/integration/targets/any_errors_fatal/80981.yml
@@ -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
diff --git a/test/integration/targets/any_errors_fatal/runme.sh b/test/integration/targets/any_errors_fatal/runme.sh
index 58f0ddfcaf..55381a7367 100755
--- a/test/integration/targets/any_errors_fatal/runme.sh
+++ b/test/integration/targets/any_errors_fatal/runme.sh
@@ -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 ]