summaryrefslogtreecommitdiffstats
path: root/test/integration/targets
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2024-08-06 22:18:03 +0200
committerGitHub <noreply@github.com>2024-08-06 22:18:03 +0200
commitc5210ad3ebe2724396958613e07d10fdea5517f5 (patch)
treee053bce4e3527909391f0698cd78ef0f54ad906c /test/integration/targets
parentFix type hints and misc mypy/pylint issues (#83724) (diff)
downloadansible-c5210ad3ebe2724396958613e07d10fdea5517f5.tar.xz
ansible-c5210ad3ebe2724396958613e07d10fdea5517f5.zip
Fix display to log severity mapping (#83712)
add caplevel to display to pass through also reverse dict order as 'last update wins' added tests ... and also log severity to log Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/ansible_log/logit.yml10
-rwxr-xr-xtest/integration/targets/ansible_log/runme.sh11
2 files changed, 18 insertions, 3 deletions
diff --git a/test/integration/targets/ansible_log/logit.yml b/test/integration/targets/ansible_log/logit.yml
index 8015726ebb..a702aed14f 100644
--- a/test/integration/targets/ansible_log/logit.yml
+++ b/test/integration/targets/ansible_log/logit.yml
@@ -1,4 +1,12 @@
- hosts: localhost
gather_facts: false
tasks:
- - ping:
+ - name: normal task
+ ping:
+
+ - name: force warning
+ ping:
+ when: "{{pepe}} == 1"
+ vars:
+ lola: 1
+ pepe: lola
diff --git a/test/integration/targets/ansible_log/runme.sh b/test/integration/targets/ansible_log/runme.sh
index 5295146b6f..496be3dbf9 100755
--- a/test/integration/targets/ansible_log/runme.sh
+++ b/test/integration/targets/ansible_log/runme.sh
@@ -4,14 +4,21 @@ set -eux
ALOG=${OUTPUT_DIR}/ansible_log_test.log
+# no log enabled
ansible-playbook logit.yml
+# ensure file is not created
[ ! -f "${ALOG}" ]
+# log enabled
ANSIBLE_LOG_PATH=${ALOG} ansible-playbook logit.yml
+# ensure log file is created
[ -f "${ALOG}" ]
-grep -q 'ping' "${ALOG}"
-
+# Ensure tasks and log levels appear
+grep -q '\[normal task\]' "${ALOG}"
+grep -q 'INFO| TASK \[force warning\]' "${ALOG}"
+grep -q 'WARNING| \[WARNING\]: conditional statements' "${ALOG}"
rm "${ALOG}"
+
# inline grep should fail if EXEC was present
set +e
ANSIBLE_LOG_PATH=${ALOG} ANSIBLE_LOG_VERBOSITY=3 ansible-playbook -v logit.yml | tee /dev/stderr | grep -q EXEC