summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_copy
diff options
context:
space:
mode:
authorjhawkesworth <jhawkesworth@users.noreply.github.com>2017-05-23 18:57:24 +0100
committerMatt Davis <nitzmahone@users.noreply.github.com>2017-05-23 10:57:24 -0700
commitb46c0985813b9b2e2b1d6b4472bdf4f0904bdc5f (patch)
tree5e32b300db300651412d1d555da45ff7b6388a6d /test/integration/targets/win_copy
parent5240e5a2304c177ff37271aa010fb34907c06cc2 (diff)
downloadansible-b46c0985813b9b2e2b1d6b4472bdf4f0904bdc5f.tar.gz
Added win_copy recursive integration test with trailing path separator. (#24523)
This is a reproducer for https://github.com/ansible/ansible/issues/23559 Tests will fail until https://github.com/ansible/ansible/pull/23581 is merged Note that I believe another commit is also needed for this to work, specifically the change from: https://github.com/ansible/ansible/pull/23326
Diffstat (limited to 'test/integration/targets/win_copy')
-rw-r--r--test/integration/targets/win_copy/tasks/main.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/integration/targets/win_copy/tasks/main.yml b/test/integration/targets/win_copy/tasks/main.yml
index e4fc6a2dbb..3e7e2b2a59 100644
--- a/test/integration/targets/win_copy/tasks/main.yml
+++ b/test/integration/targets/win_copy/tasks/main.yml
@@ -162,6 +162,50 @@
that:
- not recursive_copy_result_again|changed
+# Recursive folder copy with trailing slash (see issue 23559)
+
+
+- name: make an output subdirectory
+ win_file:
+ path: "{{win_output_dir}}\\subtrailing\\"
+ state: directory
+
+- name: test recursive copy to directory
+ win_copy:
+ src: subdir/
+ dest: "{{win_output_dir}}\\subtrailing\\"
+ register: recursive_copy_result2
+
+- name: get stats on files within sub directory
+ win_find:
+ paths: "{{win_output_dir}}\\subtrailing\\"
+ recurse: True
+ register: recurse_find_results2
+
+- name: assert recursive copy worked
+ assert:
+ that:
+ - recursive_copy_result2|changed
+ - recurse_find_results2.examined == 6 # checks that it found 3 folders and 3 files.
+# Note this is different from the test above because, by including the trailing
+# slash on the source, we only get the *contents* of the source folder
+# without the trailing slash, we would get the source folder *and* its
+# contents.
+# See 'src' parameter documentation
+# here: http://docs.ansible.com/ansible/win_copy_module.html
+
+- name: test recursive copy to directory again with source slash
+ win_copy:
+ src: subdir/
+ dest: "{{win_output_dir}}\\subtrailing\\"
+ register: recursive_copy_result_again2
+
+- name: assert recursive copy worked
+ assert:
+ that:
+ - not recursive_copy_result_again2|changed
+
+# test 'content' parameter
- name: create file with content
win_copy:
content: abc