summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_fetch
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2020-08-26 07:06:51 +1000
committerGitHub <noreply@github.com>2020-08-26 07:06:51 +1000
commit72a7cb4a2c3036da5e3abb32c50713a262d0c063 (patch)
tree5ddc69c7784cb1218c43745fcfcb8363dd2a88c8 /test/integration/targets/win_fetch
parent8897d7e2ff8fa37c25cd4ba039984fd3a9e13b33 (diff)
downloadansible-72a7cb4a2c3036da5e3abb32c50713a262d0c063.tar.gz
powershell - fix quoting values (#71411)
* powershell - fix quoting values * Add ignore for smart quote skip
Diffstat (limited to 'test/integration/targets/win_fetch')
-rw-r--r--test/integration/targets/win_fetch/meta/main.yml2
-rw-r--r--test/integration/targets/win_fetch/tasks/main.yml23
2 files changed, 25 insertions, 0 deletions
diff --git a/test/integration/targets/win_fetch/meta/main.yml b/test/integration/targets/win_fetch/meta/main.yml
new file mode 100644
index 0000000000..9f37e96cd9
--- /dev/null
+++ b/test/integration/targets/win_fetch/meta/main.yml
@@ -0,0 +1,2 @@
+dependencies:
+- setup_remote_tmp_dir
diff --git a/test/integration/targets/win_fetch/tasks/main.yml b/test/integration/targets/win_fetch/tasks/main.yml
index 1c4ff0b142..78b6fa02c9 100644
--- a/test/integration/targets/win_fetch/tasks/main.yml
+++ b/test/integration/targets/win_fetch/tasks/main.yml
@@ -187,3 +187,26 @@
# Doesn't fail anymore, only returns a message.
- "fetch_dir is not changed"
- "fetch_dir.msg"
+
+- name: create file with special characters
+ raw: Set-Content -LiteralPath '{{ remote_tmp_dir }}\abc$not var''quote‘‘' -Value 'abc'
+
+- name: fetch file with special characters
+ fetch:
+ src: '{{ remote_tmp_dir }}\abc$not var''quote‘'
+ dest: '{{ host_output_dir }}/'
+ flat: yes
+ register: fetch_special_file
+
+- name: get content of fetched file
+ command: cat {{ (host_output_dir ~ "/abc$not var'quote‘") | quote }}
+ register: fetch_special_file_actual
+ delegate_to: localhost
+
+- name: assert fetch file with special characters
+ assert:
+ that:
+ - fetch_special_file is changed
+ - fetch_special_file.checksum == '34d4150adc3347f1dd8ce19fdf65b74d971ab602'
+ - fetch_special_file.dest == host_output_dir + "/abc$not var'quote‘"
+ - fetch_special_file_actual.stdout == 'abc'