ansible/test/integration/targets/unarchive/tasks/test_quotable_characters.yml
Philip Douglass ac5f3f8bef
unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666)
Add integration tests for unarchiving as unprivileged user
Break tasks into separate files for easier reading and maintenance

Create a user by specifying a default group of 'staff' for macOS.

The user module does not actually remove the user directory on macOS,
so explicitly remove it.

Put the removal tasks in an always block to ensure they always run

Co-authored-by: Philip Douglass <philip.douglass@amadeus.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-30 15:28:05 -04:00

38 lines
1,003 B
YAML

- name: create our unarchive destination
file:
path: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
state: directory
- name: create a directory with quotable chars
file:
path: '{{ remote_tmp_dir }}/test-quotes~root'
state: directory
- name: unarchive into directory with quotable chars
unarchive:
src: "{{ remote_tmp_dir }}/test-unarchive.tar.gz"
dest: "{{ remote_tmp_dir }}/test-quotes~root"
remote_src: yes
register: unarchive08
- name: Test that unarchive succeeded
assert:
that:
- "unarchive08.changed == true"
- name: unarchive into directory with quotable chars a second time
unarchive:
src: "{{ remote_tmp_dir }}/test-unarchive.tar.gz"
dest: "{{ remote_tmp_dir }}/test-quotes~root"
remote_src: yes
register: unarchive09
- name: Test that unarchive did nothing
assert:
that:
- "unarchive09.changed == false"
- name: remove quotable chars test
file:
path: '{{ remote_tmp_dir }}/test-quotes~root'
state: absent