summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/win_script
diff options
context:
space:
mode:
authorMatt Davis <nitzmahone@users.noreply.github.com>2017-03-24 01:48:15 +0100
committerGitHub <noreply@github.com>2017-03-24 01:48:15 +0100
commit73f50b4f9ff96cad7ebe45ede0390d5d2bde8d34 (patch)
tree4c9d7b183a4031efe7c5f0aad5c1b4befcaefbd3 /test/integration/targets/win_script
parentwin_reg_stat change the module parameters for standardisation (#22732) (diff)
downloadansible-73f50b4f9ff96cad7ebe45ede0390d5d2bde8d34.tar.xz
ansible-73f50b4f9ff96cad7ebe45ede0390d5d2bde8d34.zip
fix Windows env handling (#22927)
* fixes #22441 * fixes #22655 * moves all env handling into the exec wrapper; this should work for everything but raw, which is consistent with non-Windows.
Diffstat (limited to 'test/integration/targets/win_script')
-rw-r--r--test/integration/targets/win_script/files/test_script_with_env.ps11
-rw-r--r--test/integration/targets/win_script/tasks/main.yml13
2 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/targets/win_script/files/test_script_with_env.ps1 b/test/integration/targets/win_script/files/test_script_with_env.ps1
new file mode 100644
index 0000000000..b54fd9280d
--- /dev/null
+++ b/test/integration/targets/win_script/files/test_script_with_env.ps1
@@ -0,0 +1 @@
+$env:taskenv \ No newline at end of file
diff --git a/test/integration/targets/win_script/tasks/main.yml b/test/integration/targets/win_script/tasks/main.yml
index e1f08a3dec..b4c586034f 100644
--- a/test/integration/targets/win_script/tasks/main.yml
+++ b/test/integration/targets/win_script/tasks/main.yml
@@ -192,3 +192,16 @@
that:
- "test_script_bool_result.stdout_lines[0] == 'System.Boolean'"
- "test_script_bool_result.stdout_lines[1] == 'True'"
+
+- name: run test script that uses envvars
+ script: test_script_with_env.ps1
+ environment:
+ taskenv: task
+ register: test_script_env_result
+
+- name: ensure that script ran and that environment var was passed
+ assert:
+ that:
+ - test_script_env_result | succeeded
+ - test_script_env_result.stdout_lines[0] == 'task'
+ \ No newline at end of file