From 43d3c092fae8d60d8fb0e8388091e8ee2f8d95ce Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Mon, 31 Jul 2017 14:54:34 +0200 Subject: [PATCH] Add dnf group install/upgrade integration tests (#27482) --- test/integration/targets/dnf/tasks/dnf.yml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/integration/targets/dnf/tasks/dnf.yml b/test/integration/targets/dnf/tasks/dnf.yml index d37f5ed882..0e1df619ee 100644 --- a/test/integration/targets/dnf/tasks/dnf.yml +++ b/test/integration/targets/dnf/tasks/dnf.yml @@ -240,3 +240,53 @@ - name: uninstall sos in / dnf: name=sos installroot='/' register: dnf_result + +# GROUP INSTALL +- name: install RPM Development Tools group + dnf: + name: "@RPM Development Tools" + state: present + register: dnf_result + +- debug: var=dnf_result + +- name: verify installation of the group + assert: + that: + - "not dnf_result.failed | default(False)" + - "dnf_result.changed" + +- name: verify dnf module outputs + assert: + that: + - "'changed' in dnf_result" + - "'results' in dnf_result" + +# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved +- shell: dnf -y group install "RPM Development Tools" && dnf -y group remove "RPM Development Tools" + +# GROUP UPGRADE - this will go to the same method as group install +# but through group_update - it is its invocation we're testing here +# see commit 119c9e5d6eb572c4a4800fbe8136095f9063c37b +- name: install latest RPM Development Tools + dnf: + name: "@RPM Development Tools" + state: latest + register: dnf_result + +- debug: var=dnf_result + +- name: verify installation of the group + assert: + that: + - "not dnf_result.failed | default(False)" + - "dnf_result.changed" + +- name: verify dnf module outputs + assert: + that: + - "'changed' in dnf_result" + - "'results' in dnf_result" + +# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved +- shell: dnf -y group install "RPM Development Tools" && dnf -y group remove "RPM Development Tools"