ac5f3f8bef
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>
66 lines
2.2 KiB
YAML
66 lines
2.2 KiB
YAML
- name: create our unarchive destination
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
state: directory
|
|
|
|
- name: test that unarchive works with an archive that contains non-ascii filenames
|
|
unarchive:
|
|
# Both the filename of the tarball and the filename inside the tarball have
|
|
# nonascii chars
|
|
src: "test-unarchive-nonascii-くらとみ.tar.gz"
|
|
dest: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
mode: "u+rwX,go+rX"
|
|
remote_src: no
|
|
register: nonascii_result0
|
|
|
|
- name: Check that file is really there
|
|
stat:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz/storage/àâæçéèïîôœ(copy)!@#$%^&-().jpg"
|
|
register: nonascii_stat0
|
|
|
|
- name: Assert that nonascii tests succeeded
|
|
assert:
|
|
that:
|
|
- "nonascii_result0.changed == true"
|
|
- "nonascii_stat0.stat.exists == true"
|
|
|
|
- name: remove nonascii test
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
state: absent
|
|
|
|
- name: test non-ascii with different LC_ALL
|
|
block:
|
|
- name: create our unarchive destination
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
state: directory
|
|
|
|
- name: test that unarchive works with an archive that contains non-ascii filenames
|
|
unarchive:
|
|
# Both the filename of the tarball and the filename inside the tarball have
|
|
# nonascii chars
|
|
src: "test-unarchive-nonascii-くらとみ.tar.gz"
|
|
dest: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
mode: "u+rwX,go+rX"
|
|
remote_src: no
|
|
register: nonascii_result0
|
|
|
|
- name: Check that file is really there
|
|
stat:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz/storage/àâæçéèïîôœ(copy)!@#$%^&-().jpg"
|
|
register: nonascii_stat0
|
|
|
|
- name: Assert that nonascii tests succeeded
|
|
assert:
|
|
that:
|
|
- "nonascii_result0.changed == true"
|
|
- "nonascii_stat0.stat.exists == true"
|
|
|
|
- name: remove nonascii test
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-nonascii-くらとみ-tar-gz"
|
|
state: absent
|
|
|
|
environment:
|
|
LC_ALL: C
|