Adding integration tests for symbolic modes
This commit is contained in:
parent
c21c66c740
commit
d99b835c3e
1 changed files with 154 additions and 0 deletions
|
@ -228,3 +228,157 @@
|
||||||
that:
|
that:
|
||||||
- 'file17_result.failed == true'
|
- 'file17_result.failed == true'
|
||||||
- 'file17_result.state == "directory"'
|
- 'file17_result.state == "directory"'
|
||||||
|
|
||||||
|
- name: test file creation with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u=rwx,g=rwx,o=rwx
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0777'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for all
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=a=r
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0444'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for owner
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u+w
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0644'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for group
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=g+w
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0664'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for world
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=o+w
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0666'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for owner
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u+x
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0766'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for group
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=g+x
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0776'
|
||||||
|
|
||||||
|
- name: modify symbolic mode for world
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=o+x
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0777'
|
||||||
|
|
||||||
|
- name: remove symbolic mode for world
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=o-wx
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0774'
|
||||||
|
|
||||||
|
- name: remove symbolic mode for group
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=g-wx
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0744'
|
||||||
|
|
||||||
|
- name: remove symbolic mode for owner
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u-wx
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0444'
|
||||||
|
|
||||||
|
- name: set sticky bit with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=o+t
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '01444'
|
||||||
|
|
||||||
|
- name: remove sticky bit with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=o-t
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0444'
|
||||||
|
|
||||||
|
- name: add setgid with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=g+s
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '02444'
|
||||||
|
|
||||||
|
- name: remove setgid with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=g-s
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0444'
|
||||||
|
|
||||||
|
- name: add setuid with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u+s
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '04444'
|
||||||
|
|
||||||
|
- name: remove setuid with symbolic mode
|
||||||
|
file: dest={{output_dir}}/test_symbolic state=touch mode=u-s
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert file mode
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.mode == '0444'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue