diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2018-11-08 17:39:02 +0100 |
---|---|---|
committer | Sam Doran <sdoran@redhat.com> | 2018-11-08 11:39:02 -0500 |
commit | 6ec820e26485bdbfa2e85857dad2984b94d481c9 (patch) | |
tree | 6e1ced676d298eb223e0605518e3c4f898d22849 /test/integration/targets/yum | |
parent | d2969884b45113b6588849e995de28b6fcdea418 (diff) | |
download | ansible-6ec820e26485bdbfa2e85857dad2984b94d481c9.tar.gz |
yum: add integration test for 'update foo*' (#48336)
Diffstat (limited to 'test/integration/targets/yum')
-rw-r--r-- | test/integration/targets/yum/tasks/repo.yml | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/integration/targets/yum/tasks/repo.yml b/test/integration/targets/yum/tasks/repo.yml index 3c8fe39b4e..c1c1dd8d5f 100644 --- a/test/integration/targets/yum/tasks/repo.yml +++ b/test/integration/targets/yum/tasks/repo.yml @@ -588,3 +588,58 @@ state: absent when: ansible_pkg_mgr == 'yum' + +# https://github.com/ansible/ansible/issues/45250 +- block: + - name: Install foo-1.0, foo-bar-1.0, bar-1.0 + yum: + name: "foo-1.0,foo-bar-1.0,bar-1.0" + state: present + + - name: Upgrade foo* + yum: + name: foo* + state: latest + register: yum_result + + - name: Check foo with rpm + shell: rpm -q foo + register: rpm_result + + - name: Verify update of foo + assert: + that: + - "rpm_result.stdout.startswith('foo-1.1-1')" + + - name: Check foo-bar with rpm + shell: rpm -q foo-bar + register: rpm_result + + - name: Verify update of foo-bar + assert: + that: + - "rpm_result.stdout.startswith('foo-bar-1.1-1')" + + - name: Check bar with rpm + shell: rpm -q bar + register: rpm_result + + - name: Verify bar did NOT get updated + assert: + that: + - "rpm_result.stdout.startswith('bar-1.0-1')" + + - name: Verify yum module outputs + assert: + that: + - "yum_result is changed" + - "'msg' in yum_result" + - "'rc' in yum_result" + - "'results' in yum_result" + always: + - name: Clean up + yum: + name: foo,foo-bar,bar + state: absent + + when: ansible_pkg_mgr == 'yum' |