From 62c10199d11428f014ed999a533487e69f4832b3 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Thu, 21 Sep 2023 19:52:43 +0200 Subject: [PATCH] Add intentional tests for dnf list (#81738) ci_complete ci_coverage --- test/integration/targets/dnf/tasks/repo.yml | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/integration/targets/dnf/tasks/repo.yml b/test/integration/targets/dnf/tasks/repo.yml index 4f82899cd37..7f785b14e90 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