Debian Codegraph @

test/integration/targets/unarchive/tasks/test_zip_timezone_dst.yml

raw
1 # Ensure timestamp verification for zip unarchive is correctly done
2 # Setup
3 - name: Prepare - Create test dirs
4 file:
5 path: "{{remote_tmp_dir}}/datetime-dst"
6 state: directory
7
8 - name: Setup custom DST (date saving time) for zip test
9 # datetime must match a DST period for Europe/Paris
10 file:
11 path: "{{ remote_tmp_dir }}/datetime-dst/datetime-dst.txt"
12 state: touch
13 modification_time: 202507241203.34
14
15 - name: Prepare - zip file (timezone DST)
16 shell:
17 cmd: zip -r {{remote_tmp_dir}}/test-datetime-dst.zip *
18 chdir: "{{remote_tmp_dir}}/datetime-dst/"
19
20 # Test timezone DST
21 - environment:
22 TZ: Europe/Paris
23 block:
24
25 - name: Create zip unarchive destination
26 file:
27 path: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
28 state: directory
29
30 - name: Unarchive a zip file
31 unarchive:
32 src: '{{ remote_tmp_dir }}/test-datetime-dst.zip'
33 dest: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
34 list_files: True
35 remote_src: yes
36 register: unarchive_timezone
37
38 - name: Check if file is created
39 stat:
40 path: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst/datetime-dst.txt'
41 register: file_created
42
43 - name: Verify that the file was marked as changed
44 assert:
45 that:
46 - unarchive_timezone.changed
47 - file_created.stat.exists
48
49 - name: Unarchive a zip file again
50 unarchive:
51 src: '{{ remote_tmp_dir }}/test-datetime-dst.zip'
52 dest: '{{ remote_tmp_dir }}/test-unarchive-zip-timezone-dst'
53 list_files: True
54 remote_src: yes
55 register: unarchive_timezone
56
57 - name: Verify that the task was not marked as changed
58 assert:
59 that:
60 - not unarchive_timezone.changed