1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml
Felix Fontein 24efe9ee9a
Normalize bools in tests (#5996)
* Normalize bools in tests.

* Fix typo.
2023-02-15 22:55:23 +01:00

52 lines
1.6 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: Create temporary directory for package creation
tempfile:
state: directory
register: pkgng_test_outofdate_pkg_tempdir
- name: Copy intentionally out-of-date package manifest to testhost
template:
src: MANIFEST.json.j2
# Plus-sign must be added at the destination
# CI doesn't like files with '+' in them in the repository
dest: '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
- name: Create out-of-date test package file
command:
argv:
- pkg
- create
- '--verbose'
- '--out-dir'
- '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
- '--manifest'
- '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
# pkg switched from .txz to .pkg in version 1.17.0
# Might as well look for all valid pkg extensions.
- name: Find created package file
find:
path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
use_regex: true
pattern: '.*\.(pkg|tzst|t[xbg]z|tar)'
register: pkgng_test_outofdate_pkg_tempfile
- name: There should be only one package
assert:
that:
- pkgng_test_outofdate_pkg_tempfile.files | count == 1
- name: Copy the created package file to the expected location
copy:
remote_src: true
src: '{{ pkgng_test_outofdate_pkg_tempfile.files[0].path }}'
dest: '{{ pkgng_test_outofdate_pkg_path }}'
- name: Remove temporary directory
file:
state: absent
path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'