summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author= <jhawkesworth@users.noreply.github.com>2015-10-13 06:34:18 +0100
committer= <jhawkesworth@users.noreply.github.com>2015-10-13 06:34:18 +0100
commite141101314b0260555d650567986778d8c0efe03 (patch)
tree584939874e0d9625b9f10851b5c5c893c887fa0b
parent9e364c2eb50d61800047ae93a8743ba3d8f9ef7b (diff)
downloadansible-e141101314b0260555d650567986778d8c0efe03.tar.gz
integration tests for ansible modules core 2147
-rw-r--r--test/integration/roles/test_win_file/tasks/main.yml73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/integration/roles/test_win_file/tasks/main.yml b/test/integration/roles/test_win_file/tasks/main.yml
index f823a16ff8..a8d6e92b3d 100644
--- a/test/integration/roles/test_win_file/tasks/main.yml
+++ b/test/integration/roles/test_win_file/tasks/main.yml
@@ -413,6 +413,79 @@
# that:
## - result.stat.mode == '0644'
+- name: create a directory
+ win_file: path={{win_output_dir}}/dirtest state=directory
+ register: file_result
+
+- name: stat the directory created
+ win_stat: path={{win_output_dir}}/dirtest
+ register: stat_result
+
+- name: assert the directory was created
+ assert:
+ that:
+ - file_result.changed
+ - stat_result.stat.exists
+ - stat_result.stat.isdir
+
+- name: re run create directory (bug 2147)
+ win_file: path={{win_output_dir}}/dirtest state=directory
+ register: file_result
+
+- name: stat the directory created again
+ win_stat: path={{win_output_dir}}/dirtest
+ register: stat_result
+
+- name: assert the directory exists but was not changed
+ assert:
+ that:
+ - file_result.changed == False
+ - stat_result.stat.exists
+ - stat_result.stat.isdir
+
+- name: remove empty dir we just created
+ win_file: path={{win_output_dir}}/dirtest state=absent
+ register: file_result
+
+- name: stat the removed directory
+ win_stat: path={{win_output_dir}}/dirtest
+ register: stat_result
+
+- name: assert the directory does not exist
+ assert:
+ that:
+ - file_result.changed
+ - "stat_result.stat.exists == False"
+
+- name: create dir with spaces and parens in the dir name
+ win_file: path="{{win_output_dir}}/dir with spaces (and parens)" state=directory
+ register: file_result
+
+- name: stat the directory with spaces and parens
+ win_stat: path="{{win_output_dir}}/dir with spaces (and parens)"
+ register: stat_result
+
+- name: check dir with spaces and parens in the dir name has been created
+ assert:
+ that:
+ - file_result.changed
+ - stat_result.stat.exists
+ - stat_result.stat.isdir
+
+- name: remove dir with spaces and parens in the dir name
+ win_file: path="{{win_output_dir}}/dir with spaces (and parens)" state=absent
+ register: file_result
+
+- name: stat the dir with spaces and parens in the dir name
+ win_stat: path="{{win_output_dir}}/dir with spaces (and parens)"
+ register: stat_result
+
+- name: assert dir with spaces and parens in the dir name was removed
+ assert:
+ that:
+ - file_result.changed
+ - "stat_result.stat.exists == False"
+
- name: clean up sub1
win_file: path={{win_output_dir}}/sub1 state=absent