community.general/tests/integration/targets/decompress/tasks/dest.yml
patchback[bot] 1e397ace75
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
[PR #10543/7298f25f backport][stable-10] Fix no longer valid constructs in tests (#10546)
Fix no longer valid constructs in tests (#10543)

Fix no longer valid constructs in tests.

(cherry picked from commit 7298f25fe0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-08-02 09:04:34 +02:00

52 lines
1.3 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Copy a compressed file
copy:
src: "{{ item.orig }}"
dest: "{{ item.new }}"
remote_src: true
loop:
- { orig: "{{ remote_tmp_dir }}/file.txt.gz", new: "{{ remote_tmp_dir }}/dest.txt.gz" }
- { orig: "{{ remote_tmp_dir }}/file.txt.gz", new: "{{ remote_tmp_dir }}/dest" }
- name: Decompress a file without specifying destination
decompress:
src: "{{ remote_tmp_dir }}/dest.txt.gz"
remove: true
- name: Decompress a file which lacks extension without specifying destination
decompress:
src: "{{ remote_tmp_dir }}/dest"
remove: true
- name: Stat result files
stat:
path: "{{ remote_tmp_dir }}/{{ filename }}"
loop:
- dest.txt
- dest_decompressed
loop_control:
loop_var: filename
register: result_files_stat
- name: Test that file exists
assert:
that:
- item.stat.exists
quiet: true
loop: "{{ result_files_stat.results }}"
loop_control:
label: "{{ item.stat.path }}"
- name: Delete test files
file:
path: "{{ filename }}"
state: absent
loop:
- "dest.txt"
- "dest_decompressed"
loop_control:
loop_var: filename