diff --git a/test/integration/targets/dnf/tasks/dnf.yml b/test/integration/targets/dnf/tasks/dnf.yml index 9845f3db1f7..a8cadf4d621 100644 --- a/test/integration/targets/dnf/tasks/dnf.yml +++ b/test/integration/targets/dnf/tasks/dnf.yml @@ -109,6 +109,19 @@ that: - "not dnf_result.changed" +- name: install sos again with empty string enablerepo + dnf: + name: sos + state: present + enablerepo: "" + register: dnf_result + +- name: verify no change on third install with empty string enablerepo + assert: + that: + - "dnf_result is success" + - "not dnf_result is changed" + # Multiple packages - name: uninstall sos and dos2unix dnf: name=sos,dos2unix state=removed diff --git a/test/integration/targets/dnf/tasks/repo.yml b/test/integration/targets/dnf/tasks/repo.yml index 6aa268e2b29..2210002cab0 100644 --- a/test/integration/targets/dnf/tasks/repo.yml +++ b/test/integration/targets/dnf/tasks/repo.yml @@ -361,3 +361,77 @@ dnf: name: dinginessentail state: absent + +- block: + - name: Install dinginessentail-1.0-2 + dnf: + name: "dinginessentail-1.0-2" + state: present + register: dnf_result + + - name: Check dinginessentail with rpm + shell: rpm -q dinginessentail + register: rpm_result + + - name: Verify installation + assert: + that: + - "dnf_result.changed" + - "rpm_result.stdout.startswith('dinginessentail-1.0-2')" + + - name: Verify dnf module outputs + assert: + that: + - "'msg' in dnf_result" + - "'rc' in dnf_result" + - "'results' in dnf_result" + always: + - name: Clean up + dnf: + name: dinginessentail + state: absent + +- block: + - name: Install dinginessentail < 1.1 + dnf: + name: "dinginessentail < 1.1" + state: present + register: dnf_result + + - name: Check dinginessentail with rpm + shell: rpm -q dinginessentail + register: rpm_result + + - name: Verify installation + assert: + that: + - "dnf_result.changed" + - "rpm_result.stdout.startswith('dinginessentail-1.0')" + + - name: Install dinginessentail >= 1.1 + dnf: + name: "dinginessentail >= 1.1" + state: present + register: dnf_result + + - name: Check dinginessentail with rpm + shell: rpm -q dinginessentail + register: rpm_result + + - name: Verify installation + assert: + that: + - "dnf_result.changed" + - "rpm_result.stdout.startswith('dinginessentail-1.1')" + + - name: Verify dnf module outputs + assert: + that: + - "'msg' in dnf_result" + - "'rc' in dnf_result" + - "'results' in dnf_result" + always: + - name: Clean up + dnf: + name: dinginessentail + state: absent