summaryrefslogtreecommitdiff
path: root/test/integration/targets/yum
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2018-10-30 16:28:22 +0100
committerGitHub <noreply@github.com>2018-10-30 16:28:22 +0100
commit4b8f2c99d2f2e31f1c363fdf767a07136beced69 (patch)
treee9ba70cd209a81eca7a6a4d05b74739e78609e16 /test/integration/targets/yum
parente6d99cb2bf4c4bb56dd9c3fcc2046e1e4f27c5e7 (diff)
downloadansible-4b8f2c99d2f2e31f1c363fdf767a07136beced69.tar.gz
yum: fix 'package == version' syntax (#47744)
Diffstat (limited to 'test/integration/targets/yum')
-rw-r--r--test/integration/targets/yum/tasks/repo.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/integration/targets/yum/tasks/repo.yml b/test/integration/targets/yum/tasks/repo.yml
index 33fdd3b43f..3c8fe39b4e 100644
--- a/test/integration/targets/yum/tasks/repo.yml
+++ b/test/integration/targets/yum/tasks/repo.yml
@@ -556,3 +556,35 @@
name: foo
state: absent
when: not (ansible_distribution == "Fedora" and ansible_distribution_major_version|int < 26)
+
+# https://github.com/ansible/ansible/issues/47689
+- block:
+ - name: Install foo == 1.0
+ yum:
+ name: "foo == 1.0"
+ state: present
+ register: yum_result
+
+ - name: Check foo with rpm
+ shell: rpm -q foo
+ register: rpm_result
+
+ - name: Verify installation
+ assert:
+ that:
+ - "yum_result.changed"
+ - "rpm_result.stdout.startswith('foo-1.0-1')"
+
+ - name: Verify yum module outputs
+ assert:
+ that:
+ - "'msg' in yum_result"
+ - "'rc' in yum_result"
+ - "'results' in yum_result"
+ always:
+ - name: Clean up
+ yum:
+ name: foo
+ state: absent
+
+ when: ansible_pkg_mgr == 'yum'