summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2023-09-21 19:52:43 +0200
committerGitHub <noreply@github.com>2023-09-21 19:52:43 +0200
commit62c10199d11428f014ed999a533487e69f4832b3 (patch)
treed24dc6d45e357ba73b62a01f016f69d6cf87e945
parentMake sure paths are treated correctly when building collection files manifest... (diff)
downloadansible-62c10199d11428f014ed999a533487e69f4832b3.tar.xz
ansible-62c10199d11428f014ed999a533487e69f4832b3.zip
Add intentional tests for dnf list (#81738)
ci_complete ci_coverage
-rw-r--r--test/integration/targets/dnf/tasks/repo.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/integration/targets/dnf/tasks/repo.yml b/test/integration/targets/dnf/tasks/repo.yml
index 4f82899cd3..7f785b14e9 100644
--- a/test/integration/targets/dnf/tasks/repo.yml
+++ b/test/integration/targets/dnf/tasks/repo.yml
@@ -307,3 +307,33 @@
- dinginessentail-with-weak-dep
- dinginessentail-weak-dep
state: absent
+
+- block:
+ - dnf:
+ name: dinginessentail
+ state: present
+
+ - dnf:
+ list: dinginessentail*
+ register: list_out
+
+ - name: check that dnf returns nevra for backwards compat
+ assert:
+ that:
+ - '"envra" in list_out["results"][0]'
+ - '"nevra" in list_out["results"][0]'
+
+ - set_fact:
+ passed: true
+ loop: "{{ list_out.results }}"
+ when: item.yumstate == 'installed'
+
+ - name: Test that there is yumstate=installed in the result
+ assert:
+ that:
+ - passed is defined
+ always:
+ - name: Clean up
+ dnf:
+ name: dinginessentail
+ state: absent