summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2024-06-15 03:40:30 +0200
committerGitHub <noreply@github.com>2024-06-15 03:40:30 +0200
commit6382ea168a93d80a64aab1fbd8c4f02dc5ada5bf (patch)
tree3e02b202fad79fc2228b58e572813d2bcc8dfe4d /test
parentdnf: update `use_backend` documentation (#83429) (diff)
downloadansible-6382ea168a93d80a64aab1fbd8c4f02dc5ada5bf.tar.xz
ansible-6382ea168a93d80a64aab1fbd8c4f02dc5ada5bf.zip
vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank, this value is converted to CWD and passed for further processing. Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory. Fixes: #42960 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/targets/ansible-vault/runme.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-vault/runme.sh b/test/integration/targets/ansible-vault/runme.sh
index 3630dd5b75..4165762668 100755
--- a/test/integration/targets/ansible-vault/runme.sh
+++ b/test/integration/targets/ansible-vault/runme.sh
@@ -185,6 +185,12 @@ WRONG_RC=$?
echo "rc was $WRONG_RC (1 is expected)"
[ $WRONG_RC -eq 1 ]
+# test if vault password file is not a directory
+ANSIBLE_VAULT_PASSWORD_FILE='' ansible-vault view "$@" format_1_1_AES.yml && :
+WRONG_RC=$?
+echo "rc was $WRONG_RC (1 is expected)"
+[ $WRONG_RC -eq 1 ]
+
# new 1.2 format, view, using password script with vault-id, ENFORCE_IDENTITY_MATCH=true, 'test_vault_id' provided should work
ANSIBLE_VAULT_ID_MATCH=1 ansible-vault view "$@" --vault-id=test_vault_id@password-script.py format_1_2_AES256.yml