summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/unarchive/tasks/test_tar_zst.yml
blob: 18b128159f5310efffecb576882609b19a8a87ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Only do this whole file when the "zstd" executable is present
- when:
    - zstd_available.rc == 0
    - gnu_tar.stdout != ""
  block:
    - name: create our tar.zst unarchive destination
      file:
        path: '{{remote_tmp_dir}}/test-unarchive-tar-zst'
        state: directory

    - name: unarchive a tar.zst file
      unarchive:
        src: '{{remote_tmp_dir}}/test-unarchive.tar.zst'
        dest: '{{remote_tmp_dir}}/test-unarchive-tar-zst'
        remote_src: yes
      register: unarchive02

    - name: verify that the file was marked as changed
      assert:
        that:
          - "unarchive02.changed == true"
          # Verify that no file list is generated
          - "'files' not in unarchive02"

    - name: verify that the file was unarchived
      file:
        path: '{{remote_tmp_dir}}/test-unarchive-tar-zst/foo-unarchive.txt'
        state: file

    - name: remove our tar.zst unarchive destination
      file:
        path: '{{remote_tmp_dir}}/test-unarchive-tar-zst'
        state: absent

    - name: test owner/group perms
      include_tasks: test_owner_group.yml
      vars:
        ext: tar.zst
        archive: test-unarchive.tar.zst
        testfile: foo-unarchive.txt