windows: fix for checking locked system files (#30665)

* fix for checking locked system files

* moved functions to share module util and created tests

* fixed windows-paths test based on win_stat changes
This commit is contained in:
Jordan Borean 2017-11-16 10:04:03 +10:00 committed by ansibot
commit e16e6313c7
12 changed files with 166 additions and 29 deletions

View file

@ -105,6 +105,18 @@
- shellout|skipped
- shellout.msg is search('exists')
- name: test creates with hidden system file, should skip
win_shell: echo test
args:
creates: C:\pagefile.sys
register: shellout
- name: validate result
assert:
that:
- shellout|skipped
- shellout.msg is search('exists')
- name: ensure testfile is still present
win_stat:
path: c:\testfile.txt