diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/connection_windows_ssh/tests_fetch.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/connection_windows_ssh/tests_fetch.yml')
-rw-r--r-- | test/integration/targets/connection_windows_ssh/tests_fetch.yml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/integration/targets/connection_windows_ssh/tests_fetch.yml b/test/integration/targets/connection_windows_ssh/tests_fetch.yml new file mode 100644 index 0000000..0b4fe94 --- /dev/null +++ b/test/integration/targets/connection_windows_ssh/tests_fetch.yml @@ -0,0 +1,41 @@ +# This must be a play as we need to invoke it with the ANSIBLE_SCP_IF_SSH env +# to control the mechanism used. Unfortunately while ansible_scp_if_ssh is +# documented, it isn't actually used hence the separate invocation +--- +- name: further fetch tests with metachar characters in filename + hosts: windows + force_handlers: yes + serial: 1 + gather_facts: no + + tasks: + - name: setup remote tmp dir + import_role: + name: ../../setup_remote_tmp_dir + + - name: create remote file with metachar in name + win_copy: + content: some content + dest: '{{ remote_tmp_dir }}\file ^with &whoami' + + - name: test fetch against a file with cmd metacharacters + block: + - name: fetch file with metachar in name + fetch: + src: '{{ remote_tmp_dir }}\file ^with &whoami' + dest: ansible-test.txt + flat: yes + register: fetch_res + + - name: assert fetch file with metachar in name + assert: + that: + - fetch_res is changed + - fetch_res.checksum == '94e66df8cd09d410c62d9e0dc59d3a884e458e05' + + always: + - name: remove local copy of file + file: + path: ansible-test.txt + state: absent + delegate_to: localhost |