mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 21:54:22 -07:00
* archive: Fix ignored sanity test parameter-list-no-elements
* Fix wrong argument type
* Add changelog
* Add integration test for a list of files
(cherry picked from commit 31443e57b1
)
Co-authored-by: Amin Vakil <info@aminvakil.com>
This commit is contained in:
parent
659ef811a3
commit
02f0abfb36
6 changed files with 32 additions and 17 deletions
|
@ -256,6 +256,29 @@
|
|||
- name: remove our xz
|
||||
file: path="{{ output_dir }}/archive_02.xz" state=absent
|
||||
|
||||
- name: archive multiple files as list
|
||||
archive:
|
||||
path:
|
||||
- "{{ output_dir }}/empty.txt"
|
||||
- "{{ output_dir }}/foo.txt"
|
||||
- "{{ output_dir }}/bar.txt"
|
||||
dest: "{{ output_dir }}/archive_list.gz"
|
||||
format: gz
|
||||
register: archive_gz_list_result
|
||||
|
||||
- name: verify that the files archived
|
||||
file: path={{output_dir}}/archive_list.gz state=file
|
||||
|
||||
- name: check if gz file exists and includes all text files
|
||||
assert:
|
||||
that:
|
||||
- "{{ archive_gz_list_result.changed }}"
|
||||
- "{{ 'archived' in archive_gz_list_result }}"
|
||||
- "{{ archive_gz_list_result['archived'] | length }} == 3"
|
||||
|
||||
- name: remove our gz
|
||||
file: path="{{ output_dir }}/archive_list.gz" state=absent
|
||||
|
||||
- name: test that gz archive that contains non-ascii filenames
|
||||
archive:
|
||||
path: "{{ output_dir }}/*.txt"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue