archive - idempotency enhancement for 4.0.0 (#3075)

* Initial Commit

* Comparing with tar file checksums rather than tar header checksums

* Added changelog fragment

* Revert "Comparing with tar file checksums rather than tar header checksums"

This reverts commit bed4b17107.

* Restricting idempotency tests by format

* Applying review suggestions
This commit is contained in:
Ajpantuso 2021-08-12 02:18:38 -04:00 committed by GitHub
commit 1e466df863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 21 deletions

View file

@ -19,12 +19,12 @@
format: "{{ format }}"
register: file_content_idempotency_after
# After idempotency fix result will be reliably changed for all formats
- name: Assert task status is changed - file content idempotency ({{ format }})
assert:
that:
- file_content_idempotency_after is not changed
when: "format in ('tar', 'zip')"
- file_content_idempotency_after is changed
# Only ``zip`` archives are guaranteed to compare file content checksums rather than header checksums
when: "format == 'zip'"
- name: Remove archive - file content idempotency ({{ format }})
file:
@ -54,12 +54,10 @@
format: "{{ format }}"
register: file_name_idempotency_after
# After idempotency fix result will be reliably changed for all formats
- name: Check task status - file name idempotency ({{ format }})
assert:
that:
- file_name_idempotency_after is not changed
when: "format in ('tar', 'zip')"
- file_name_idempotency_after is changed
- name: Remove archive - file name idempotency ({{ format }})
file:
@ -89,12 +87,12 @@
format: "{{ format }}"
register: single_file_content_idempotency_after
# After idempotency fix result will be reliably changed for all formats
- name: Assert task status is changed - single file content idempotency ({{ format }})
assert:
that:
- single_file_content_idempotency_after is not changed
when: "format in ('tar', 'zip')"
- single_file_content_idempotency_after is changed
# ``tar`` archives are not guaranteed to identify changes to file content if the file meta properties are unchanged.
when: "format != 'tar'"
- name: Remove archive - single file content idempotency ({{ format }})
file:
@ -125,11 +123,12 @@
register: single_file_name_idempotency_after
# After idempotency fix result will be reliably changed for all formats
# The gz, bz2, and xz formats do not store the original file name
# so it is not possible to identify a change in this scenario.
- name: Check task status - single file name idempotency ({{ format }})
assert:
that:
- single_file_name_idempotency_after is not changed
- single_file_name_idempotency_after is changed
when: "format in ('tar', 'zip')"
- name: Remove archive - single file name idempotency ({{ format }})