summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2019-07-30 22:32:17 +0530
committerBrian Coca <bcoca@users.noreply.github.com>2019-07-30 13:02:17 -0400
commit2ebc4e1e7eda61f133d9425872e2a858bae92ec4 (patch)
treedf8be154dd03921dfb5ce6698580507e1d898d84 /test
parent8a6c7a97ccedf99d5bf4c39e0118ef61501d15ee (diff)
downloadansible-2ebc4e1e7eda61f133d9425872e2a858bae92ec4.tar.gz
inventory: Handle IndexError while parsing limit file (#59776)
Handle IndexError exception raised while parsing the limit file. Fixes: #59695 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/targets/inventory/runme.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/targets/inventory/runme.sh b/test/integration/targets/inventory/runme.sh
index 31854c8778..b6ac952a0c 100755
--- a/test/integration/targets/inventory/runme.sh
+++ b/test/integration/targets/inventory/runme.sh
@@ -2,6 +2,17 @@
set -x
+empty_limit_file="/tmp/limit_file"
+touch "${empty_limit_file}"
+
+cleanup() {
+ if [[ -f "${empty_limit_file}" ]]; then
+ rm -rf "${empty_limit_file}"
+ fi
+}
+
+trap 'cleanup' EXIT
+
# https://github.com/ansible/ansible/issues/52152
# Ensure that non-matching limit causes failure with rc 1
ansible-playbook -i ../../inventory --limit foo playbook.yml
@@ -10,6 +21,9 @@ if [ "$?" != "1" ]; then
exit 1
fi
+# Ensure that non-matching limit causes failure with rc 1
+ansible-playbook -i ../../inventory --limit @"${empty_limit_file}" playbook.yml
+
ansible-playbook -i ../../inventory "$@" strategy.yml
ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=always ansible-playbook -i ../../inventory "$@" strategy.yml
ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=never ansible-playbook -i ../../inventory "$@" strategy.yml