mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
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:
parent
5e20fd0943
commit
e16e6313c7
12 changed files with 166 additions and 29 deletions
|
@ -295,6 +295,9 @@
|
|||
- stat_readonly.stat.size == 3
|
||||
|
||||
# Requires more work once modular powershell utils are in
|
||||
- name: weird issue, need to access the file in anyway to get the correct date stats
|
||||
win_command: powershell.exe Test-Path {{win_output_dir}}\win_stat\nested\hard-link.ps1
|
||||
|
||||
- name: test win_stat on hard link file
|
||||
win_stat:
|
||||
path: "{{win_output_dir}}\\win_stat\\nested\\hard-link.ps1"
|
||||
|
@ -541,3 +544,13 @@
|
|||
win_file:
|
||||
path: "{{win_output_dir}}\\win_stat"
|
||||
state: absent
|
||||
|
||||
- name: get stat of pagefile
|
||||
win_stat:
|
||||
path: C:\pagefile.sys
|
||||
register: pagefile_stat
|
||||
|
||||
- name: assert get stat of pagefile
|
||||
assert:
|
||||
that:
|
||||
- pagefile_stat.stat.exists == True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue