Adds integration test

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Abhijeet Kasurde 4 months ago
parent 7e47bfc106
commit 6c7f61da50

@ -9,6 +9,7 @@
- import_tasks: test_tar_gz_content_differs.yml
- import_tasks: test_tar_zst.yml
- import_tasks: test_zip.yml
- import_tasks: test_zip_timezone_dst.yml
- import_tasks: test_exclude.yml
- import_tasks: test_include.yml
- import_tasks: test_parent_not_writeable.yml

@ -72,6 +72,7 @@
- created/include
- created/exclude
- created/other
- datetime-dst
- name: Prepare - Create test files
file:
@ -91,9 +92,19 @@
- other/other-1.ext
- other/other-2.ext
- name: Setup custom DST (date saving time) for zip test
# datetime must match a DST period for Europe/Paris
file:
path: "{{ remote_tmp_dir }}/datetime-dst/datetime-dst.txt"
state: touch
modification_time: 202507241203.34
- name: Prepare - zip file
shell: zip -r {{remote_tmp_dir}}/unarchive-00.zip * chdir={{remote_tmp_dir}}/created/
- name: Prepare - zip file (timezone DST)
shell: zip -r {{remote_tmp_dir}}/test-datetime-dst.zip * chdir={{remote_tmp_dir}}/datetime-dst/
- name: Prepare - tar file
shell: tar czvf {{remote_tmp_dir}}/unarchive-00.tar * chdir={{remote_tmp_dir}}/created/

@ -0,0 +1,47 @@
---
# Ensure timestamp verification for zip unarchive is correctly done
- block:
- name: Create zip unarchive destination
file:
path: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
state: directory
environment:
TZ: Europe/Paris
- name: Unarchive a zip file
unarchive:
src: '{{ remote_tmp_dir }}/test-datetime-dst.zip'
dest: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
list_files: True
remote_src: yes
environment:
TZ: Europe/Paris
- name: Verify that the file was marked as changed
assert:
that:
- unarchive_timezone.changed
- name: Unarchive a zip file again
unarchive:
src: '{{ remote_tmp_dir }}/test-datetime-dst.zip'
dest: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
list_files: True
remote_src: yes
register: unarchive_timezone
environment:
TZ: Europe/Paris
- name: Verify that the task was not marked as changed
assert:
that:
- not unarchive_timezone.changed
# FreeBSD fails because of permissions issues
# MacOSX fails because of group owner issues
when: not ansible_facts['distribution'] in ['FreeBSD', 'MacOSX']
always:
- name: Remove zip destination
file:
path: '{{remote_tmp_dir}}/test-unarchive-zip-timezone-dst'
state: absent
Loading…
Cancel
Save