summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJan Losinski <losinski@wh2.tu-dresden.de>2015-05-12 18:43:16 +0200
committerToshio Kuratomi <toshio@fedoraproject.org>2015-05-12 20:16:17 +0200
commitdcb54d9657882638a1ccd661d83d8400d9d47499 (patch)
treeee2d3f351721297426eca27c4ec7b3c247c14751 /test
parentFix method of exiting task loop (v2) (diff)
downloadansible-dcb54d9657882638a1ccd661d83d8400d9d47499.tar.xz
ansible-dcb54d9657882638a1ccd661d83d8400d9d47499.zip
Add integration test to verify #10073
In issue #10073 a misbehaviour in literal handling for inline lookup arguments that can cause unexpected behaviur was reported. This integration testcase reproduce the problem. After applying pull request #10991 the issue is fixed and the test passes. Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
Diffstat (limited to 'test')
-rw-r--r--test/integration/roles/test_lookups/tasks/main.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/roles/test_lookups/tasks/main.yml b/test/integration/roles/test_lookups/tasks/main.yml
index 8440ff5772..f9970f70a2 100644
--- a/test/integration/roles/test_lookups/tasks/main.yml
+++ b/test/integration/roles/test_lookups/tasks/main.yml
@@ -129,3 +129,26 @@
debug: msg={{item}}
with_items: things2
+
+# BUG #10073 nested template handling
+
+- name: set variable that clashes
+ set_fact:
+ LOGNAME: foobar
+
+
+- name: get LOGNAME environment var value
+ shell: echo {{ '$LOGNAME' }}
+ register: known_var_value
+
+- name: do the lookup for env LOGNAME
+ set_fact:
+ test_val: "{{ lookup('env', 'LOGNAME') }}"
+
+- debug: var=test_val
+
+- name: compare values
+ assert:
+ that:
+ - "test_val == known_var_value.stdout"
+