diff options
Diffstat (limited to 'test/integration/targets/inventory-invalid-group')
4 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/targets/inventory-invalid-group/aliases b/test/integration/targets/inventory-invalid-group/aliases new file mode 100644 index 0000000..1d28bdb --- /dev/null +++ b/test/integration/targets/inventory-invalid-group/aliases @@ -0,0 +1,2 @@ +shippable/posix/group5 +context/controller diff --git a/test/integration/targets/inventory-invalid-group/inventory.ini b/test/integration/targets/inventory-invalid-group/inventory.ini new file mode 100644 index 0000000..762c9da --- /dev/null +++ b/test/integration/targets/inventory-invalid-group/inventory.ini @@ -0,0 +1,5 @@ +[local-] +testhost ansible_connection=local + +[all:vars] +ansible_python_interpreter="{{ ansible_playbook_python }}" diff --git a/test/integration/targets/inventory-invalid-group/runme.sh b/test/integration/targets/inventory-invalid-group/runme.sh new file mode 100755 index 0000000..8c40554 --- /dev/null +++ b/test/integration/targets/inventory-invalid-group/runme.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -eux +set -o pipefail + +command=(ansible-playbook -v -i inventory.ini test.yml) + never='Invalid characters were found in group names but not replaced' +always='Invalid characters were found in group names and automatically' + +ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=never "${command[@]}" -l "local-" 2>&1 | grep -c -e "${never}" +ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=always "${command[@]}" -l "local_" 2>&1 | grep -c -e "${always}" +ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=ignore "${command[@]}" -l "local-" 2>&1 | grep -cv -e "${never}" -e "${always}" +ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=silently "${command[@]}" -l "local_" 2>&1 | grep -cv -e "${never}" -e "${always}" diff --git a/test/integration/targets/inventory-invalid-group/test.yml b/test/integration/targets/inventory-invalid-group/test.yml new file mode 100644 index 0000000..2208f9d --- /dev/null +++ b/test/integration/targets/inventory-invalid-group/test.yml @@ -0,0 +1,3 @@ +- hosts: testhost + gather_facts: no + tasks: [] |