mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
re-enable non-pipelined mode for Powershell (#25012)
* fixes #23986 * fixes 3rd-party Windows connection plugins that don't support pipelining (eg awsrun)
This commit is contained in:
@@ -94,14 +94,14 @@
|
||||
- "raw_result.stdout_lines[0] == 'wwe=raw'"
|
||||
|
||||
# TODO: this test doesn't work anymore since we had to internally map Write-Host to Write-Output
|
||||
#- name: run a raw command with unicode chars and quoted args (from https://github.com/ansible/ansible-modules-core/issues/1929)
|
||||
# raw: Write-Host --% icacls D:\somedir\ /grant "! ЗАО. Руководство":F
|
||||
# register: raw_result2
|
||||
#
|
||||
#- name: make sure raw passes command as-is and doesn't split/rejoin args
|
||||
# assert:
|
||||
# that:
|
||||
# - "raw_result2.stdout_lines[0] == '--% icacls D:\\\\somedir\\\\ /grant \"! ЗАО. Руководство\":F'"
|
||||
- name: run a raw command with unicode chars and quoted args (from https://github.com/ansible/ansible-modules-core/issues/1929)
|
||||
raw: Write-Host --% icacls D:\somedir\ /grant "! ЗАО. Руководство":F
|
||||
register: raw_result2
|
||||
|
||||
- name: make sure raw passes command as-is and doesn't split/rejoin args
|
||||
assert:
|
||||
that:
|
||||
- "raw_result2.stdout_lines[0] == '--% icacls D:\\\\somedir\\\\ /grant \"! ЗАО. Руководство\":F'"
|
||||
|
||||
# Assumes MaxShellsPerUser == 30 (the default)
|
||||
|
||||
@@ -116,12 +116,13 @@
|
||||
- "not raw_with_items_result|failed"
|
||||
- "raw_with_items_result.results|length == 32"
|
||||
|
||||
- name: test raw with job to ensure that preamble-free InputEncoding is working
|
||||
raw: Start-Job { echo yo } | Receive-Job -Wait
|
||||
register: raw_job_result
|
||||
|
||||
- name: check raw with job result
|
||||
assert:
|
||||
that:
|
||||
- raw_job_result | succeeded
|
||||
- raw_job_result.stdout_lines[0] == 'yo'
|
||||
# TODO: this test fails, since we're back to passing raw commands without modification
|
||||
#- name: test raw with job to ensure that preamble-free InputEncoding is working
|
||||
# raw: Start-Job { echo yo } | Receive-Job -Wait
|
||||
# register: raw_job_result
|
||||
#
|
||||
#- name: check raw with job result
|
||||
# assert:
|
||||
# that:
|
||||
# - raw_job_result | succeeded
|
||||
# - raw_job_result.stdout_lines[0] == 'yo'
|
||||
|
||||
@@ -193,15 +193,16 @@
|
||||
- "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'
|
||||
|
||||
# FIXME: re-enable this test once script can run under the wrapper with powershell
|
||||
#- 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'
|
||||
#
|
||||
Reference in New Issue
Block a user