diff options
-rw-r--r-- | test/integration/targets/setup_rpm_repo/files/create-repo.py | 4 | ||||
-rw-r--r-- | test/integration/targets/yum/tasks/repo.yml | 55 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/integration/targets/setup_rpm_repo/files/create-repo.py b/test/integration/targets/setup_rpm_repo/files/create-repo.py index 6d5e1db312..bf5cf5440a 100644 --- a/test/integration/targets/setup_rpm_repo/files/create-repo.py +++ b/test/integration/targets/setup_rpm_repo/files/create-repo.py @@ -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), ] 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' |