yum: add integration test for 'update foo*' (#48336)

This commit is contained in:
Martin Krizek 2018-11-08 17:39:02 +01:00 committed by Sam Doran
parent d2969884b4
commit 6ec820e264
2 changed files with 59 additions and 0 deletions

View file

@ -13,6 +13,10 @@ SPECS = [
RPM('foo', '1.0', '1', None),
RPM('foo', '1.0', '2', '1'),
RPM('foo', '1.1', '1', '1'),
RPM('foo-bar', '1.0', '1', None),
RPM('foo-bar', '1.1', '1', None),
RPM('bar', '1.0', '1', None),
RPM('bar', '1.1', '1', None),
]

View file

@ -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'