1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

16 commits

Author SHA1 Message Date
Ross Williams
220b7e08b6 pkgng: test pkgsite parameter 2021-10-13 12:44:24 +00:00
Ross Williams
a52f4bb4a4 pkgng: Ansible 2.9 has no "false" Jinja2 test
Apparently Ansible 2.9 doesn't have the "false" test
in Jinja2 contexts. Switching to use `rejectattr(...)`
instead of `selectattr(..., "false")`.
2021-10-13 12:23:46 +00:00
Ross Williams
10a4f5ffcc pkgng: convert generator to list for 2.9
Ansible 2.9 can't count items from a generator,
so convert `select` filter output via `list`
before passing to `count`.
2021-10-13 11:14:11 +00:00
Ross Williams
32ce141397 pkgng: add test prepare task
Make sure test environment does not contain the
test package.
2021-10-13 02:24:45 +00:00
Ross Williams
4c5239e82f pkgng: fix check_mode for annotate
Actions specified in the `annotate` parameter would
always be performed, even if `check_mode=yes`.

This commit fixes `check_mode` for the annotation
functions and adds integration tests to ensure that
check mode is honored in the future.
2021-10-12 18:37:39 +00:00
Ross Williams
8f013549fd pkgng: test invalid annotate strings
Ensure that some likely to occur, invalid strings
given to the annotate module parameter 1. fail,
2. do not cause an exception, and 3. do not create
any actual annotations on packages.
2021-10-12 18:33:05 +00:00
Ross Williams
b872b294fd pkgng: test multiple annotations
Test multiple annotations specified both in new (YAML list)
syntax and old (comma-delimited) syntax.

Rename some annotation test tags from the single-annotation
tests to make sure that single and multiple annotation tests
don't collide.
2021-10-12 18:09:33 +00:00
Ross Williams
8453c368c1 pkgng: test annotation for single package
Add/modify/remove annotation for a single package
2021-10-12 15:03:25 +00:00
Ross Williams
6c5f9810b0 pkgng: pass tests when package dependencies change
Tests that install packages with dependencies were failing
when those dependencies were not already installed, because
the count of installed packages was greater than the count
of requested to be installed packages. This change checks
for a count of installed packages that is greater than or
equal to the count of requested to be installed packages.

Example:
  - Test installs packages `zsh` and `fish`
  - `fish` has a dependency on `pcre2`
  - `pkg` reports `Number of packages to be installed: 3`
2021-10-12 13:43:05 +00:00
Ross Williams
a803240941 pkgng: test autoremove=yes only on FreeBSD > 12
The CI test runner on FreeBSD 12.0 times out when
downloading large packages.
2021-10-12 01:52:30 +00:00
Ross Williams
4f18ef5ba6 pkgng: add test for autoremove=yes
Install package with known dependencies, then
remove it and ask autoremove to run.
2021-10-11 19:55:28 +00:00
Ross Williams
aa88d68ebc pkgng: use YAML lists for multiple packages
I had been following the documentation examples, and
specifiying multiple packages on one line. The right way
to do it is with YAML list syntax.
2021-10-11 19:28:26 +00:00
Ross Williams
98ccc58ba0 pkgng: test state=latest for mixed install/upgrade
Test that a list of packages given, one not installed
and one installed but out-of-date are handled correctly.
2021-10-11 19:25:06 +00:00
Ross Williams
73eafc126f pkgng: test install multiple packages
Multiple packages should install with a single
invocation of the `pkg` utility.
2021-10-11 18:14:38 +00:00
Ross Williams
8805f408d6 pkgng: refactor tests for task reuse
Several tests need to install an out-of-date package
to test whether upgrades occur successfully, so this
commit refactors out the generation of the test package.

Also, factor out things like the name and path of the
test package so that is more maintainable should the
target test package (currently `zsh`) ever need to
change.
2021-10-11 17:10:35 +00:00
Ross Williams
d075c83ff2 pkgng: move FreeBSD tasks to imported file
Refactoring tests for more reuse and easier
readability.
2021-10-11 16:24:08 +00:00