mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
pkgng: test annotation for single package
Add/modify/remove annotation for a single package
This commit is contained in:
parent
6c5f9810b0
commit
8453c368c1
1 changed files with 51 additions and 0 deletions
|
@ -294,6 +294,57 @@
|
||||||
- "'autoremoved' is in(pkgng_example7.msg)"
|
- "'autoremoved' is in(pkgng_example7.msg)"
|
||||||
- not pkgng_example7_cleanup.changed
|
- not pkgng_example7_cleanup.changed
|
||||||
|
|
||||||
|
##
|
||||||
|
## pkgng - example - single annotations
|
||||||
|
##
|
||||||
|
- name: Install and annotate single package
|
||||||
|
pkgng:
|
||||||
|
name: '{{ pkgng_test_pkg_name }}'
|
||||||
|
annotation: '+ansibletest=added'
|
||||||
|
register: pkgng_example8_add_annotation
|
||||||
|
|
||||||
|
- name: Install and annotate single package
|
||||||
|
pkgng:
|
||||||
|
name: '{{ pkgng_test_pkg_name }}'
|
||||||
|
annotation: '+ansibletest=duplicate'
|
||||||
|
ignore_errors: yes
|
||||||
|
register: pkgng_example8_add_annotation_failure
|
||||||
|
|
||||||
|
- name: Verify annotation is actually there
|
||||||
|
command: 'pkg annotate -q -S {{ pkgng_test_pkg_name }} ansibletest'
|
||||||
|
register: pkgng_example8_add_annotation_verify
|
||||||
|
|
||||||
|
- name: Modify annotation on single package
|
||||||
|
pkgng:
|
||||||
|
name: '{{ pkgng_test_pkg_name }}'
|
||||||
|
annotation: ':ansibletest=modified'
|
||||||
|
register: pkgng_example8_modify_annotation
|
||||||
|
|
||||||
|
- name: Verify annotation has been modified
|
||||||
|
command: 'pkg annotate -q -S {{ pkgng_test_pkg_name }} ansibletest'
|
||||||
|
register: pkgng_example8_modify_annotation_verify
|
||||||
|
|
||||||
|
- name: Remove annotation on single package
|
||||||
|
pkgng:
|
||||||
|
name: '{{ pkgng_test_pkg_name }}'
|
||||||
|
annotation: '-ansibletest'
|
||||||
|
register: pkgng_example8_remove_annotation
|
||||||
|
|
||||||
|
- name: Verify annotation has been removed
|
||||||
|
command: 'pkg annotate -q -S {{ pkgng_test_pkg_name }} ansibletest'
|
||||||
|
register: pkgng_example8_remove_annotation_verify
|
||||||
|
|
||||||
|
- name: Ensure pkgng annotations on single packages work correctly
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- pkgng_example8_add_annotation.changed
|
||||||
|
- pkgng_example8_add_annotation_failure.failed
|
||||||
|
- 'pkgng_example8_add_annotation_verify.stdout_lines | first == "added"'
|
||||||
|
- pkgng_example8_modify_annotation.changed
|
||||||
|
- 'pkgng_example8_modify_annotation_verify.stdout_lines | first == "modified"'
|
||||||
|
- pkgng_example8_remove_annotation.changed
|
||||||
|
- 'pkgng_example8_remove_annotation_verify.stdout_lines | count == 0'
|
||||||
|
|
||||||
##
|
##
|
||||||
## pkgng - example - Install single package in jail
|
## pkgng - example - Install single package in jail
|
||||||
##
|
##
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue