ec8a556538
Only add data when there is data to add also avoid clobbering existing data with empty file fixes #45843 * remove redundant code, update comments * fix mock dataloader, original does not return None * added test
18 lines
825 B
Bash
Executable file
18 lines
825 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
# test no dupes when dependencies in b and c point to a in roles:
|
|
[ "$(ansible-playbook no_dupes.yml -i ../../inventory --tags inroles "$@" | grep -c '"msg": "A"')" = "1" ]
|
|
[ "$(ansible-playbook no_dupes.yml -i ../../inventory --tags acrossroles "$@" | grep -c '"msg": "A"')" = "1" ]
|
|
|
|
# but still dupe across plays
|
|
[ "$(ansible-playbook no_dupes.yml -i ../../inventory "$@" | grep -c '"msg": "A"')" = "2" ]
|
|
|
|
# include/import can execute another instance of role
|
|
[ "$(ansible-playbook allowed_dupes.yml -i ../../inventory --tags importrole "$@" | grep -c '"msg": "A"')" = "2" ]
|
|
[ "$(ansible-playbook allowed_dupes.yml -i ../../inventory --tags includerole "$@" | grep -c '"msg": "A"')" = "2" ]
|
|
|
|
|
|
# ensure role data is merged correctly
|
|
ansible-playbook data_integrity.yml -i ../../inventory "$@"
|