Commit Graph

40 Commits (2268a37d4d1ee93e7eb1b2eec656251f263adcf2)

Author SHA1 Message Date
Florian Apolloner a7e4479d01 Fix DNF idempotency. (#66209) 5 years ago
Adam Miller ed86907587 DNF Handle Empty AppStream stream definition (#63819)
* DNF Handle Empty AppStream stream definition

Fixes #63683

Signed-off-by: Adam Miller <admiller@redhat.com>

* Switch Fedora dnf test target modularity to stratis

In Fedora 29, the metadata was not properly set for a default stream
for ripgrep even though there is a profile called "default", however
that's an arbitrary string and the module maintainer must set the
default stream (which it never was for the ripgrep module, thus
failing the "empty stream" install test)

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Martin Krizek 18b9ce8b82
Integration tests: prevent loop squashing (#63847)
1. the feature will be deprecated in 2.11
2. these modules support passing lists
3. loop squashing does not work with collections
5 years ago
Sam Doran 47796af64f
Change dummy package name in yum/dnf tests to not collide with an actual package (#60225)
When targeting 'foo*' in tests, it pulled in packages other than the dummy packages in our testing repo that have many dependencies, some of which were causing tests to fail.

Also change 'bar' package name to avoid the same issue in the future.
5 years ago
Sam Doran 16d6fcf514
Improve dnf test formatting and fix RHEL 8 module name (#58648)
- use single include_vars task rather than multiple set_fact tasks
- use multi-line YAML to break up long conditionals
- use version() test rather than direct comparisions
- use different appstream package on RHEL since '@swig:3.0/default' is not working in the GA
5 years ago
Sam Doran 18feeb51a8
Change integration tests in order to pass on Fedora 30 (#58081)
* Use different package for DNF tests
    Ninja caused errors in Fedora 30. This works in both Fedora 29 and 30.

* Fix git integration tests
    Git >= 2.21.0 has either a bug or change in behavior where it errors when fetching a
    repository containing submodules that are behind the upstream submodule commits.
    It's weird and I don't fully understand it.

    Get around this my checking out specific commits from a repository rather than
    switch the origin URL.

* Fix PostgreSQL tests
    The error message is slightly different
5 years ago
Martin Krizek 826b99d4bd dnf: fix wildcard matching for state: absent (#56013)
* dnf: fix wildcard matching for state: absent

Fixes #55938

* Add changelog...

* Fix sanity check failure...
5 years ago
Matt Clay 149336319a
Clean up local_action and delegate_to in tests. (#55835)
* Remove unnecessary delegate_to in tests.

* Remove incorrect delegate_to in tests.

* Remove unnecessary use of local_action in tests.

* Remove incorrect use of local_action in tests.

* Remove unnecessary use of local_action in tests.

* Remove incorrect use of local_action in tests.

* Remove unnecessary use of local_action in tests.

* Use delegate_to instead of local_action in tests.

* Use setup_remote_tmp_dir instead of TMPDIR.
5 years ago
Martin Krizek 239fb1f68d yum/dnf: Add download_dir param (#53171) 5 years ago
Jordan Borean 670a45c3ac
test dnf - fix groups idempotency on RHEL and fix postgresql issue (#51319) 6 years ago
Matt Clay a20d0d1afb
Fix dnf integration test issues. (#51251)
* update/enable rhel8 beta integration tests for yum and dnf

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix typo in conditional for dnf/tasks/main.yml

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix var scoping for environment checks

Signed-off-by: Adam Miller <admiller@redhat.com>

* Disable install via path on RHEL.
6 years ago
Martin Krizek 9ec9f18b13 dnf: allow to operate on file paths (#51080)
Fixes #50843
6 years ago
Jordan Borean b967f4dcc1 dnf/yum - added install_weak_deps option (#50525)
* dnf/yum - added install_weak_deps option

* skip creating weak dep packages if rpm doesn't support it

* fix rpm check for older hosts
6 years ago
Jordan Borean 63e454a4b2 dnf - fix conf_file loading (#50515) 6 years ago
Adam Miller ca084889c7 fix order of dnf api operations so transactions don't fail (#50038)
* fix order of dnf api operations so transactions don't fail

Previously dnf.base.fill_sack() was called before
dnf.base.update_cache() which apparently breaks dnf transaction
logic as per https://bugzilla.redhat.com/show_bug.cgi?id=1658694

Fixes #49060

Signed-off-by: Adam Miller <admiller@redhat.com>

* add changelog and test case

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Jordan Borean 198f1e1bea
Revert "Fixes #49362 module dnf: install python3-dnf preferably over python2-dnf. (#49402)" (#49633)
This reverts commit 3247eec97a.
6 years ago
Robert de Bock 3247eec97a Fixes #49362 module dnf: install python3-dnf preferably over python2-dnf. (#49402)
* Create python3and2

Adding tests to see if dnf still works when python-2 and python-3 are installed.

* Update main.yml

Include the tests that run on python 2 and python 3, based on the package manager.

* Update dnf.py

Use python3-dnf by default, otherwise python2-dnf.

* Rename python3and2 to python3and2.yml

Rename.
6 years ago
Adam Miller 2b878546d3 fix yamllint sanity
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Adam Miller 4a06e95671 dnf to support modularity module appstream specs
Fixes #48743

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Jordan Borean f0535bac80 dnf yum: fix tests running on Fedora 29 (#47910)
* dnf yum: fix tests running on Fedora 29

* wrap in always block
6 years ago
Adam Miller 1e3b927a73 Improve error condition handling for dnf module (#44770)
- Fix comma separated list handling for package names
- Fix error message for unavailable/unknown package install attempt
- Fix pkg install result output generation

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Matt Clay 22d5f5d97f Get packages for dnf and yum tests from S3. 6 years ago
Adam Miller 397febd343 YUM4/DNF compatibility via yum action plugin (#44322)
* YUM4/DNF compatibility via yum action plugin

DNF does not natively support allow_downgrade as an option, instead
that is always the default (not configurable by the administrator)
so it had to be implemented

 - Fixed group actions in check mode to report correct changed state
 - Better error handling for depsolve and transaction errors in DNF
 - Fixed group action idempotent transactions
 - Add use_backend to yum module/action plugin
 - Fix dnf handling of autoremove (didn't used to work nor had a
   default value specified, now does work and matches default
   behavior of yum)
 - Enable installroot tests for yum4(dnf) integration testing, dnf
   backend now supports that
 - Switch from zip to bc for certain package install/remove test
   cases in yum integration tests. The dnf depsolver downgrades
   python when you uninstall zip which alters the test environment
   and we have no control over that.
 - Add changelog fragment
 - Return a pkg_mgr fact if it was not previously set.
6 years ago
Adam Miller 6d95624c22 Refactor yum and dnf, add feature parity (#43621)
* Refactor yum and dnf, add feature parity

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove unnecessary module_utils, move the classes into the module code

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove yum -> yum4, out of scope

Signed-off-by: Adam Miller <admiller@redhat.com>

* use ABCMeta

Signed-off-by: Adam Miller <admiller@redhat.com>

* re-arrange run() caller vs callee

Signed-off-by: Adam Miller <admiller@redhat.com>

* make sanity checks happy

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix yum unit tests

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove unecessary debug statements, fix typo

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix licensing and attribution in yumdnf module_util

Signed-off-by: Adam Miller <admiller@redhat.com>

* include fix from PR 40737

original commit 5cbda9658a
original Author: Strahinja Kustudic <kustodian@gmail.com>

yum will fail on 'No space left on device', fixes #32791 (#40737)

During the installing of packages if yum runs out of free disk space,
some post install scripts could fail (like e.g. when the kernel
package generates initramfs), but yum would still exit with a status
0.  This is bad, especially for the kernel package, because it makes
it unable to boot.  Because the yum module is usually used for
automation, which means the users cannot read every message yum
prints, it's better that the yum module fails if it detects that
there is no free space on the disk.

Signed-off-by: Adam Miller <admiller@redhat.com>

* Revert "fix licensing and attribution in yumdnf module_util"

This reverts commit 59e11de5a2.

* move fetch_rpm_from_url out of yumdnf module_util

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix the move of fetch_rpm_from_url

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Peter Janes 67493ebdee Add a 'releasever' parameter for dnf. Fixes #33314. (#37493)
* Add a 'releasever' parameter for dnf. #33314

* Set a default value for releasever

* Fix a variable name typo
6 years ago
Martin Krizek bf702e6d88
dnf: handle error when latest pkg not found (#39720)
* dnf: handle error when latest pkg not found

* Add integration test
6 years ago
Matt Clay 9599630976
Fixes for dnf and user integration tests. (#34603)
* Fix user test.
* Use `dnf` instead of `yum` in dnf test.
* Install correct version of rpmfluff for tests.
7 years ago
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
7 years ago
Martin Krizek 3c1fb9b547
Use custom rpm repo script for dnf testing (#32737)
* Use custom rpm repo script for dnf testing

* Switch to a jinja2 test
7 years ago
Martin Krizek 0daacdccf8 dnf: add environment upgrade test 7 years ago
Martin Krizek de299ef77c dnf: fix TypeError when env/group failed 7 years ago
Martin Krizek 503bfaf38b dnf: add integration tests (based on yum tests) (#28881) 7 years ago
Matt Clay c59e32469f Add Fedora Python 3 Docker images and fix tests. (#27794)
* Add new Fedora docker images with Python 3.
* Use consistent env var for lookup test.
* Fix testing of virtualenv with Python 3.
* Fix docker_secret tests on Fedora 26.
* Add Python 3 support to Fedora postgresql test.
* Add Python 3 support to Fedora mysql tests.
* Fix uri test server for Python 3 on Fedora.
* Fix iso_extract test for Python 3 on Fedora.
* Add Python 3 support for Fedora to openssl tests.
* Fix dnf group test for Python 3 on Fedora.
* Use force with user deletion in become test.
7 years ago
Martin Krizek 43d3c092fa Add dnf group install/upgrade integration tests (#27482) 7 years ago
berenddeschouwer b1c57ea443 Installroot OS version check fix (#20180)
Cast to int before checking the OS version.
This prevents the DNF tests from running on
Fedora < 23
8 years ago
Toshio Kuratomi cd2516bf8d Revert "Revert "Add --installroot to YUM and DNF modules, issue #11310""
This reverts commit b73ddd5212.
8 years ago
Matt Clay b73ddd5212 Revert "Add --installroot to YUM and DNF modules, issue #11310" 8 years ago
berenddeschouwer 1fdcda0996 Add --installroot to YUM and DNF modules, issue #11310 (#19861)
* Add --installroot to YUM and DNF modules, issue #11310

This continues ansible-modules-core#1558, and
ansible-modules-core#1669

Allow specifying installroot for the yum and dnf modules
to install and remove packages in a location other than /.

* Remove empty aliases

* Simpler installroot set default logic
8 years ago
Adrien Vergé 0e834fc9e4 Fix cosmetic problems in YAML source
This change corrects problems reported by the `yamllint` linter.

Since key duplication problems were removed in 4d48711, this commit
mainly fixes trailing spaces and extra empty lines at beginning/end of
files.
8 years ago
Toshio Kuratomi 02859a3e32 Add tests for dnf modelled after the yum tests (#18226) 8 years ago