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/install_single_package.yml
Felix Fontein 1ab2a5f1bc
Add default license header to files which have no copyright or license header yet (#5074)
* Add default license header to files which have no copyright or license header yet.

* yml extension should have been xml...
2022-08-05 14:03:38 +02:00

58 lines
1.8 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: Verify package sentinel file is not present
stat:
path: '{{ pkgng_test_install_prefix | default("") }}{{ pkgng_test_pkg_sentinelfile_path }}'
get_attributes: no
get_checksum: no
get_mime: no
register: pkgng_install_stat_before
- name: Install package
pkgng: &pkgng_install_params
name: '{{ pkgng_test_pkg_name }}'
jail: '{{ pkgng_test_jail | default(omit) }}'
chroot: '{{ pkgng_test_chroot | default(omit) }}'
rootdir: '{{ pkgng_test_rootdir | default(omit) }}'
register: pkgng_install
- name: Remove package (checkmode)
pkgng:
<<: *pkgng_install_params
state: absent
check_mode: yes
register: pkgng_install_checkmode
- name: Install package (idempotent, cached)
pkgng:
<<: *pkgng_install_params
cached: yes
register: pkgng_install_idempotent_cached
- name: Verify package sentinel file is present
stat:
path: '{{ pkgng_test_install_prefix | default("") }}{{ pkgng_test_pkg_sentinelfile_path }}'
get_attributes: no
get_checksum: no
get_mime: no
register: pkgng_install_stat_after
- name: Remove test package (if requested)
pkgng:
<<: *pkgng_install_params
state: absent
when: 'pkgng_test_install_cleanup | default(False)'
- name: Ensure pkgng installs package correctly
assert:
that:
- not pkgng_install_stat_before.stat.exists
- pkgng_install.changed
- pkgng_install_checkmode.changed
- not pkgng_install_idempotent_cached.changed
- not pkgng_install_idempotent_cached.stdout is match("Updating \w+ repository catalogue\.\.\.")
- pkgng_install_stat_after.stat.exists
- pkgng_install_stat_after.stat.executable