mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add more tests for copy/file/template with harlinks
This commit is contained in:
parent
2b14fdbce3
commit
bc66faa328
3 changed files with 126 additions and 20 deletions
|
@ -143,13 +143,42 @@
|
|||
stat: path={{output_dir}}/hard.txt
|
||||
register: hlstat2
|
||||
|
||||
- name: verify that hard link was made
|
||||
- name: verify that hard link is still the same after timestamp updated
|
||||
assert:
|
||||
that:
|
||||
- "hlstat1.stat.inode == hlstat2.stat.inode"
|
||||
|
||||
- name: create hard link to file 2
|
||||
file: src={{output_file}} dest={{output_dir}}/hard.txt state=hard
|
||||
register: hlink_result
|
||||
|
||||
- name: verify that hard link creation is idempotent
|
||||
assert:
|
||||
that:
|
||||
- "hlink_result.changed == False"
|
||||
|
||||
- name: Change mode on a hard link
|
||||
file: src={{output_file}} dest={{output_dir}}/hard.txt mode=0701
|
||||
register: file6_mode_change
|
||||
|
||||
- name: verify that the hard link was touched
|
||||
assert:
|
||||
that:
|
||||
- "file6_touch_result.changed == true"
|
||||
|
||||
- name: stat1
|
||||
stat: path={{output_file}}
|
||||
register: hlstat1
|
||||
|
||||
- name: stat2
|
||||
stat: path={{output_dir}}/hard.txt
|
||||
register: hlstat2
|
||||
|
||||
- name: verify that hard link is still the same after timestamp updated
|
||||
assert:
|
||||
that:
|
||||
- "hlstat1.stat.inode == hlstat2.stat.inode"
|
||||
- "hlstat1.stat.mode == '0701'"
|
||||
|
||||
- name: create a directory
|
||||
file: path={{output_dir}}/foobar state=directory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue