summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_shell
diff options
context:
space:
mode:
authorMatt Davis <nitzmahone@users.noreply.github.com>2017-03-23 17:48:15 -0700
committerGitHub <noreply@github.com>2017-03-23 17:48:15 -0700
commit73f50b4f9ff96cad7ebe45ede0390d5d2bde8d34 (patch)
tree4c9d7b183a4031efe7c5f0aad5c1b4befcaefbd3 /test/integration/targets/win_shell
parentf1ab879bb62cbec56230b7db04a8a08cf3086d12 (diff)
downloadansible-73f50b4f9ff96cad7ebe45ede0390d5d2bde8d34.tar.gz
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_shell')
-rw-r--r--test/integration/targets/win_shell/tasks/main.yml12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/integration/targets/win_shell/tasks/main.yml b/test/integration/targets/win_shell/tasks/main.yml
index 5e50b72eda..16759bb283 100644
--- a/test/integration/targets/win_shell/tasks/main.yml
+++ b/test/integration/targets/win_shell/tasks/main.yml
@@ -17,8 +17,10 @@
- shellout.stdout == "hello from Ansible\r\n"
- shellout.stdout_lines == ["hello from Ansible"]
-- name: execute a powershell cmdlet with multi-line output
- win_shell: Write-Output "hello from Ansible"; Write-Output "another line"; Write-Output "yet another line"
+- name: execute a powershell cmdlet with multi-line output that uses environment with embedded quotes
+ win_shell: Write-Output "hello from Ansible"; Write-Output "another line"; Write-Output "yet another line"; Write-Output "envvar was $env:taskvar"
+ environment:
+ taskvar: "o'doyle rules"
register: shellout
- name: validate result
@@ -26,15 +28,15 @@
that:
- shellout|success
- shellout|changed
- - shellout.cmd == 'Write-Output "hello from Ansible"; Write-Output "another line"; Write-Output "yet another line"'
+ - shellout.cmd == 'Write-Output "hello from Ansible"; Write-Output "another line"; Write-Output "yet another line"; Write-Output "envvar was $env:taskvar"'
- shellout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
- shellout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
- shellout.rc == 0
- shellout.start is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
# assertion disabled since it does not pass on Windows Server 2016
# - shellout.stderr == ""
- - shellout.stdout == "hello from Ansible\r\nanother line\r\nyet another line\r\n"
- - shellout.stdout_lines == ["hello from Ansible","another line", "yet another line"]
+ - shellout.stdout == "hello from Ansible\r\nanother line\r\nyet another line\r\nenvvar was o'doyle rules\r\n"
+ - shellout.stdout_lines == ["hello from Ansible","another line", "yet another line", "envvar was o'doyle rules"]
- name: execute something nonexistent
win_shell: bogus_command1234