summaryrefslogtreecommitdiffstats
path: root/test/integration/targets
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2023-09-29 07:48:25 +0200
committerGitHub <noreply@github.com>2023-09-29 07:48:25 +0200
commit01d190f3d26840ffe12aee048678183246f2f504 (patch)
tree247547d820319f17b4f6e330c232f330b4b424d5 /test/integration/targets
parentansible-test - Update sanity test requirements (#81810) (diff)
downloadansible-01d190f3d26840ffe12aee048678183246f2f504.tar.xz
ansible-01d190f3d26840ffe12aee048678183246f2f504.zip
Add intentional tests for module_utils/yumdnf.py (#81776)
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/dnf/tasks/dnf.yml13
-rw-r--r--test/integration/targets/dnf/tasks/repo.yml74
2 files changed, 87 insertions, 0 deletions
diff --git a/test/integration/targets/dnf/tasks/dnf.yml b/test/integration/targets/dnf/tasks/dnf.yml
index 9845f3db1f..a8cadf4d62 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 6aa268e2b2..2210002cab 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