mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
pkgng: add state=absent test
Also renumber `jail=...` test to make diffs less noisy when adding more non-jailed tests.
This commit is contained in:
parent
840cb8f408
commit
9a867a38ee
1 changed files with 58 additions and 11 deletions
|
@ -49,6 +49,53 @@
|
||||||
- pkgng_example1_stat_after.stat.exists
|
- pkgng_example1_stat_after.stat.exists
|
||||||
- pkgng_example1_stat_after.stat.executable
|
- pkgng_example1_stat_after.stat.executable
|
||||||
|
|
||||||
|
##
|
||||||
|
## pkgng - example - remove single package
|
||||||
|
##
|
||||||
|
- name: Verify zsh binary is present
|
||||||
|
stat:
|
||||||
|
path: /usr/local/bin/zsh
|
||||||
|
get_attributes: no
|
||||||
|
get_checksum: no
|
||||||
|
get_mime: no
|
||||||
|
register: pkgng_example2_stat_before
|
||||||
|
|
||||||
|
- name: Install zsh (checkmode)
|
||||||
|
pkgng:
|
||||||
|
name: zsh
|
||||||
|
check_mode: yes
|
||||||
|
register: pkgng_example2_checkmode
|
||||||
|
|
||||||
|
- name: Remove zsh
|
||||||
|
pkgng:
|
||||||
|
name: zsh
|
||||||
|
state: absent
|
||||||
|
register: pkgng_example2
|
||||||
|
|
||||||
|
- name: Remove zsh (idempotent)
|
||||||
|
pkgng:
|
||||||
|
name: zsh
|
||||||
|
state: absent
|
||||||
|
register: pkgng_example2_idempotent
|
||||||
|
|
||||||
|
- name: Verify zsh binary is not present
|
||||||
|
stat:
|
||||||
|
path: /usr/local/bin/zsh
|
||||||
|
get_attributes: no
|
||||||
|
get_checksum: no
|
||||||
|
get_mime: no
|
||||||
|
register: pkgng_example2_stat_after
|
||||||
|
|
||||||
|
- name: Ensure pkgng installs package correctly
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- pkgng_example2_stat_before.stat.exists
|
||||||
|
- pkgng_example2_stat_before.stat.executable
|
||||||
|
- not pkgng_example2_checkmode.changed
|
||||||
|
- pkgng_example2.changed
|
||||||
|
- not pkgng_example2_idempotent.changed
|
||||||
|
- not pkgng_example2_stat_after.stat.exists
|
||||||
|
|
||||||
##
|
##
|
||||||
## pkgng - example - Install zsh in jail
|
## pkgng - example - Install zsh in jail
|
||||||
##
|
##
|
||||||
|
@ -68,13 +115,13 @@
|
||||||
get_attributes: no
|
get_attributes: no
|
||||||
get_checksum: no
|
get_checksum: no
|
||||||
get_mime: no
|
get_mime: no
|
||||||
register: pkgng_example2_stat_before
|
register: pkgng_jail_example1_stat_before
|
||||||
|
|
||||||
- name: Install zsh
|
- name: Install zsh
|
||||||
pkgng:
|
pkgng:
|
||||||
name: zsh
|
name: zsh
|
||||||
jail: testjail
|
jail: testjail
|
||||||
register: pkgng_example2
|
register: pkgng_jail_example1
|
||||||
|
|
||||||
- name: Remove zsh (checkmode)
|
- name: Remove zsh (checkmode)
|
||||||
pkgng:
|
pkgng:
|
||||||
|
@ -82,13 +129,13 @@
|
||||||
state: absent
|
state: absent
|
||||||
jail: testjail
|
jail: testjail
|
||||||
check_mode: yes
|
check_mode: yes
|
||||||
register: pkgng_example2_checkmode
|
register: pkgng_jail_example1_checkmode
|
||||||
|
|
||||||
- name: Install zsh (idempotent)
|
- name: Install zsh (idempotent)
|
||||||
pkgng:
|
pkgng:
|
||||||
name: zsh
|
name: zsh
|
||||||
jail: testjail
|
jail: testjail
|
||||||
register: pkgng_example2_idempotent
|
register: pkgng_jail_example1_idempotent
|
||||||
|
|
||||||
- name: Verify zsh binary is present
|
- name: Verify zsh binary is present
|
||||||
stat:
|
stat:
|
||||||
|
@ -96,17 +143,17 @@
|
||||||
get_attributes: no
|
get_attributes: no
|
||||||
get_checksum: no
|
get_checksum: no
|
||||||
get_mime: no
|
get_mime: no
|
||||||
register: pkgng_example2_stat_after
|
register: pkgng_jail_example1_stat_after
|
||||||
|
|
||||||
- name: Ensure pkgng installs package correctly
|
- name: Ensure pkgng installs package correctly
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- not pkgng_example2_stat_before.stat.exists
|
- not pkgng_jail_example1_stat_before.stat.exists
|
||||||
- pkgng_example2.changed
|
- pkgng_jail_example1.changed
|
||||||
- pkgng_example2_checkmode.changed
|
- pkgng_jail_example1_checkmode.changed
|
||||||
- not pkgng_example2_idempotent.changed
|
- not pkgng_jail_example1_idempotent.changed
|
||||||
- pkgng_example2_stat_after.stat.exists
|
- pkgng_jail_example1_stat_after.stat.exists
|
||||||
- pkgng_example2_stat_after.stat.executable
|
- pkgng_jail_example1_stat_after.stat.executable
|
||||||
always:
|
always:
|
||||||
- name: Stop and remove testjail
|
- name: Stop and remove testjail
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue