mirror of https://github.com/ansible/ansible.git
Added code to catch exception when ZIP file has invalid timestamp (#81092)
Fixes: #81092 Signed-off-by: gilsongpfe <gilson.gpf@gmail.com> Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>pull/81520/head
parent
0bab08ee33
commit
47eb531491
@ -0,0 +1,3 @@
|
||||
---
|
||||
bugfixes:
|
||||
- unarchive - catch exception when ZIP file has an invalid timestamp (https://github.com/ansible/ansible/issues/81092).
|
Binary file not shown.
@ -0,0 +1,40 @@
|
||||
- name: create our unarchive destination
|
||||
file:
|
||||
path: "{{ remote_tmp_dir }}/test_invalid"
|
||||
state: directory
|
||||
|
||||
- name: test that unarchive works with an archive that contains file with invalid datetimestamp
|
||||
unarchive:
|
||||
src: "zip_with_invalid_datetimestamp.zip"
|
||||
dest: "{{ remote_tmp_dir }}/test_invalid"
|
||||
remote_src: no
|
||||
register: invalid_result0
|
||||
|
||||
- name: Check that file is really there
|
||||
stat:
|
||||
path: "{{ remote_tmp_dir }}/test_invalid/eggs.txt"
|
||||
register: invalid_stat0
|
||||
|
||||
- name: Assert that invalid zip tests succeeded
|
||||
assert:
|
||||
that:
|
||||
- "invalid_result0.changed == true"
|
||||
- "invalid_stat0.stat.exists == true"
|
||||
|
||||
- name: test that unarchive fails with an archive that contains file with invalid datetimestamp (idempotency)
|
||||
unarchive:
|
||||
src: "zip_with_invalid_datetimestamp.zip"
|
||||
dest: "{{ remote_tmp_dir }}/test_invalid"
|
||||
remote_src: no
|
||||
register: invalid_result1
|
||||
ignore_errors: true
|
||||
|
||||
- name: Assert that invalid zip tests succeeded
|
||||
assert:
|
||||
that:
|
||||
- "invalid_result1.changed == false"
|
||||
|
||||
- name: remove invalid test directory
|
||||
file:
|
||||
path: "{{ remote_tmp_dir }}/test_invalid"
|
||||
state: absent
|
Loading…
Reference in New Issue