Change dummy package name in yum/dnf tests to not collide with an actual package (#60225)

When targeting 'foo*' in tests, it pulled in packages other than the dummy packages in our testing repo that have many dependencies, some of which were causing tests to fail.

Also change 'bar' package name to avoid the same issue in the future.
This commit is contained in:
Sam Doran 2019-08-07 14:26:55 -04:00 committed by GitHub
parent 5a6003d0ed
commit 47796af64f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 260 additions and 260 deletions

View file

@ -299,10 +299,10 @@
state: present state: present
register: dnf_result register: dnf_result
- name: check foo with rpm - name: check dinginessentail with rpm
command: rpm -q foo command: rpm -q dinginessentail
failed_when: False failed_when: False
register: foo_result register: dinginessentail_result
- name: verify installation of the group - name: verify installation of the group
assert: assert:
@ -310,7 +310,7 @@
- not dnf_result is failed - not dnf_result is failed
- dnf_result is changed - dnf_result is changed
- "'results' in dnf_result" - "'results' in dnf_result"
- foo_result.rc == 0 - dinginessentail_result.rc == 0
- name: install the group again - name: install the group again
dnf: dnf:
@ -324,30 +324,30 @@
- not dnf_result is changed - not dnf_result is changed
- "'msg' in dnf_result" - "'msg' in dnf_result"
- name: verify that bar is not installed - name: verify that landsidescalping is not installed
dnf: dnf:
name: bar name: landsidescalping
state: absent state: absent
- name: install the group again but also with a package that is not yet installed - name: install the group again but also with a package that is not yet installed
dnf: dnf:
name: name:
- "@Custom Group" - "@Custom Group"
- bar - landsidescalping
state: present state: present
register: dnf_result register: dnf_result
- name: check bar with rpm - name: check landsidescalping with rpm
command: rpm -q bar command: rpm -q landsidescalping
failed_when: False failed_when: False
register: bar_result register: landsidescalping_result
- name: verify bar is installed - name: verify landsidescalping is installed
assert: assert:
that: that:
- dnf_result is changed - dnf_result is changed
- "'results' in dnf_result" - "'results' in dnf_result"
- bar_result.rc == 0 - landsidescalping_result.rc == 0
- name: try to install the group again, with --check to check 'changed' - name: try to install the group again, with --check to check 'changed'
dnf: dnf:
@ -362,9 +362,9 @@
- not dnf_result is changed - not dnf_result is changed
- "'msg' in dnf_result" - "'msg' in dnf_result"
- name: remove bar after test - name: remove landsidescalping after test
dnf: dnf:
name: bar name: landsidescalping
state: absent state: absent
# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved # cleanup until https://github.com/ansible/ansible/issues/27377 is resolved
@ -455,9 +455,9 @@
state: latest state: latest
register: dnf_result register: dnf_result
- name: check bar with rpm - name: check landsidescalping with rpm
command: rpm -q bar command: rpm -q landsidescalping
register: bar_result register: landsidescalping_result
- name: verify installation of the environment - name: verify installation of the environment
assert: assert:
@ -465,12 +465,12 @@
- not dnf_result is failed - not dnf_result is failed
- dnf_result is changed - dnf_result is changed
- "'results' in dnf_result" - "'results' in dnf_result"
- bar_result.rc == 0 - landsidescalping_result.rc == 0
# Fedora 28 (DNF 2) does not support this, just remove the package itself # Fedora 28 (DNF 2) does not support this, just remove the package itself
- name: remove bar package on Fedora 28 - name: remove landsidescalping package on Fedora 28
dnf: dnf:
name: bar name: landsidescalping
state: absent state: absent
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int <= 28 when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int <= 28

View file

@ -1,203 +1,203 @@
- block: - block:
- name: Install foo-1.0-1 - name: Install dinginessentail-1.0-1
dnf: dnf:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 again - name: Install dinginessentail-1.0-1 again
dnf: dnf:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not dnf_result.changed" - "not dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'msg' in dnf_result" - "'msg' in dnf_result"
# ============================================================================ # ============================================================================
- name: Install foo-1:1.0-2 - name: Install dinginessentail-1:1.0-2
dnf: dnf:
name: "foo-1:1.0-2.{{ ansible_architecture }}" name: "dinginessentail-1:1.0-2.{{ ansible_architecture }}"
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
# ============================================================================ # ============================================================================
- name: Update to the latest foo - name: Update to the latest dinginessentail
dnf: dnf:
name: foo name: dinginessentail
state: latest state: latest
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file (downgrade) - name: Install dinginessentail-1.0-1 from a file (downgrade)
dnf: dnf:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
allow_downgrade: True allow_downgrade: True
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
- name: Remove foo - name: Remove dinginessentail
dnf: dnf:
name: foo name: dinginessentail
state: absent state: absent
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file - name: Install dinginessentail-1.0-1 from a file
dnf: dnf:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file again - name: Install dinginessentail-1.0-1 from a file again
dnf: dnf:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not dnf_result.changed" - "not dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-2 from a file - name: Install dinginessentail-1.0-2 from a file
dnf: dnf:
name: "{{ repodir }}/foo-1.0-2.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "dnf_result.changed" - "dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify dnf module outputs - name: Verify dnf module outputs
assert: assert:
that: that:
- "'results' in dnf_result" - "'results' in dnf_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-2 from a file again - name: Install dinginessentail-1.0-2 from a file again
dnf: dnf:
name: "{{ repodir }}/foo-1.0-2.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
state: present state: present
register: dnf_result register: dnf_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not dnf_result.changed" - "not dnf_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
# ============================================================================ # ============================================================================
- name: Remove foo - name: Remove dinginessentail
dnf: dnf:
name: foo name: dinginessentail
state: absent state: absent
- name: Try to install incompatible arch - name: Try to install incompatible arch
dnf: dnf:
name: "{{ repodir_ppc64 }}/foo-1.0-1.ppc64.rpm" name: "{{ repodir_ppc64 }}/dinginessentail-1.0-1.ppc64.rpm"
state: present state: present
register: dnf_result register: dnf_result
ignore_errors: yes ignore_errors: yes
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
ignore_errors: yes ignore_errors: yes
@ -209,18 +209,18 @@
- "dnf_result is failed" - "dnf_result is failed"
# ============================================================================ # ============================================================================
# Should install foo-with-weak-dep and foo-weak-dep # Should install dinginessentail-with-weak-dep and dinginessentail-weak-dep
- name: Install package with defaults - name: Install package with defaults
dnf: dnf:
name: foo-with-weak-dep name: dinginessentail-with-weak-dep
state: present state: present
- name: Check if foo-with-weak-dep is installed - name: Check if dinginessentail-with-weak-dep is installed
shell: rpm -q foo-with-weak-dep shell: rpm -q dinginessentail-with-weak-dep
register: rpm_main_result register: rpm_main_result
- name: Check if foo-weak-dep is installed - name: Check if dinginessentail-weak-dep is installed
shell: rpm -q foo-weak-dep shell: rpm -q dinginessentail-weak-dep
register: rpm_weak_result register: rpm_weak_result
- name: Verify install with weak deps - name: Verify install with weak deps
@ -229,25 +229,25 @@
- rpm_main_result.rc == 0 - rpm_main_result.rc == 0
- rpm_weak_result.rc == 0 - rpm_weak_result.rc == 0
- name: Uninstall foo weak dep packages - name: Uninstall dinginessentail weak dep packages
dnf: dnf:
name: name:
- foo-with-weak-dep - dinginessentail-with-weak-dep
- foo-weak-dep - dinginessentail-weak-dep
state: absent state: absent
- name: Install package with weak deps but skip weak deps - name: Install package with weak deps but skip weak deps
dnf: dnf:
name: foo-with-weak-dep name: dinginessentail-with-weak-dep
install_weak_deps: False install_weak_deps: False
state: present state: present
- name: Check if foo-with-weak-dep is installed - name: Check if dinginessentail-with-weak-dep is installed
shell: rpm -q foo-with-weak-dep shell: rpm -q dinginessentail-with-weak-dep
register: rpm_main_result register: rpm_main_result
- name: Check if foo-weak-dep is installed - name: Check if dinginessentail-weak-dep is installed
shell: rpm -q foo-weak-dep shell: rpm -q dinginessentail-weak-dep
register: rpm_weak_result register: rpm_weak_result
ignore_errors: yes ignore_errors: yes
@ -258,18 +258,18 @@
- rpm_weak_result.rc == 1 # the weak dependency shouldn't be installed - rpm_weak_result.rc == 1 # the weak dependency shouldn't be installed
# https://github.com/ansible/ansible/issues/55938 # https://github.com/ansible/ansible/issues/55938
- name: Install foo-* - name: Install dinginessentail-*
dnf: dnf:
name: foo-* name: dinginessentail-*
state: present state: present
- name: Uninstall foo-* - name: Uninstall dinginessentail-*
dnf: dnf:
name: foo-* name: dinginessentail-*
state: absent state: absent
- name: Check if all foo packages are removed - name: Check if all dinginessentail packages are removed
shell: rpm -qa foo-* | wc -l shell: rpm -qa dinginessentail-* | wc -l
register: rpm_result register: rpm_result
- name: Verify rpm result - name: Verify rpm result
@ -280,7 +280,7 @@
- name: Clean up - name: Clean up
dnf: dnf:
name: name:
- foo - dinginessentail
- foo-with-weak-dep - dinginessentail-with-weak-dep
- foo-weak-dep - dinginessentail-weak-dep
state: absent state: absent

View file

@ -8,7 +8,7 @@
<uservisible>true</uservisible> <uservisible>true</uservisible>
<display_order>1024</display_order> <display_order>1024</display_order>
<packagelist> <packagelist>
<packagereq type="mandatory">foo</packagereq> <packagereq type="mandatory">dinginessentail</packagereq>
</packagelist> </packagelist>
</group> </group>
@ -20,7 +20,7 @@
<uservisible>false</uservisible> <uservisible>false</uservisible>
<display_order>1024</display_order> <display_order>1024</display_order>
<packagelist> <packagelist>
<packagereq type="mandatory">bar</packagereq> <packagereq type="mandatory">landsidescalping</packagereq>
</packagelist> </packagelist>
</group> </group>

View file

@ -10,15 +10,15 @@ RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
SPECS = [ SPECS = [
RPM('foo', '1.0', '1', None, None), RPM('dinginessentail', '1.0', '1', None, None),
RPM('foo', '1.0', '2', '1', None), RPM('dinginessentail', '1.0', '2', '1', None),
RPM('foo', '1.1', '1', '1', None), RPM('dinginessentail', '1.1', '1', '1', None),
RPM('foo-bar', '1.0', '1', None, None), RPM('dinginessentail-olive', '1.0', '1', None, None),
RPM('foo-bar', '1.1', '1', None, None), RPM('dinginessentail-olive', '1.1', '1', None, None),
RPM('bar', '1.0', '1', None, None), RPM('landsidescalping', '1.0', '1', None, None),
RPM('bar', '1.1', '1', None, None), RPM('landsidescalping', '1.1', '1', None, None),
RPM('foo-with-weak-dep', '1.0', '1', None, ['foo-weak-dep']), RPM('dinginessentail-with-weak-dep', '1.0', '1', None, ['dinginessentail-weak-dep']),
RPM('foo-weak-dep', '1.0', '1', None, None), RPM('dinginessentail-weak-dep', '1.0', '1', None, None),
] ]

View file

@ -22,7 +22,7 @@
- name: On Fedora 28 the above won't remove the group which results in a failure in repo.yml below - name: On Fedora 28 the above won't remove the group which results in a failure in repo.yml below
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
when: when:
- ansible_distribution in ['Fedora'] - ansible_distribution in ['Fedora']

View file

@ -1,19 +1,19 @@
- block: - block:
- name: Install foo-1.0-1 - name: Install dinginessentail-1.0-1
yum: yum:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -22,21 +22,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 again - name: Install dinginessentail-1.0-1 again
yum: yum:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -45,21 +45,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1:1.0-2 - name: Install dinginessentail-1:1.0-2
yum: yum:
name: "foo-1:1.0-2.{{ ansible_architecture }}" name: "dinginessentail-1:1.0-2.{{ ansible_architecture }}"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -68,27 +68,27 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
- name: Remove foo - name: Remove dinginessentail
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
# ============================================================================ # ============================================================================
- name: Downgrade foo - name: Downgrade dinginessentail
yum: yum:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
allow_downgrade: yes allow_downgrade: yes
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -97,21 +97,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Update to the latest foo - name: Update to the latest dinginessentail
yum: yum:
name: foo name: dinginessentail
state: latest state: latest
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -120,21 +120,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file (higher version is already installed) - name: Install dinginessentail-1.0-1 from a file (higher version is already installed)
yum: yum:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -143,26 +143,26 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
- name: Remove foo - name: Remove dinginessentail
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file - name: Install dinginessentail-1.0-1 from a file
yum: yum:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -171,21 +171,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-1 from a file again - name: Install dinginessentail-1.0-1 from a file again
yum: yum:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -194,21 +194,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-2 from a file - name: Install dinginessentail-1.0-2 from a file
yum: yum:
name: "{{ repodir }}/foo-1.0-2.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -217,21 +217,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Install foo-1.0-2 from a file again - name: Install dinginessentail-1.0-2 from a file again
yum: yum:
name: "{{ repodir }}/foo-1.0-2.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -240,22 +240,22 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Try to downgrade foo without allow_downgrade being set - name: Try to downgrade dinginessentail without allow_downgrade being set
yum: yum:
name: foo-1.0-1 name: dinginessentail-1.0-1
state: present state: present
allow_downgrade: no allow_downgrade: no
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -264,22 +264,22 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Update foo with update_only set - name: Update dinginessentail with update_only set
yum: yum:
name: foo name: dinginessentail
state: latest state: latest
update_only: yes update_only: yes
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -288,21 +288,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
- name: Remove foo - name: Remove dinginessentail
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
# ============================================================================ # ============================================================================
- name: Try to update foo which is not installed, update_only is set - name: Try to update dinginessentail which is not installed, update_only is set
yum: yum:
name: foo name: dinginessentail
state: latest state: latest
update_only: yes update_only: yes
register: yum_result register: yum_result
ignore_errors: yes ignore_errors: yes
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
ignore_errors: yes ignore_errors: yes
@ -323,13 +323,13 @@
# ============================================================================ # ============================================================================
- name: Try to install incompatible arch - name: Try to install incompatible arch
yum: yum:
name: "{{ repodir_ppc64 }}/foo-1.0-1.ppc64.rpm" name: "{{ repodir_ppc64 }}/dinginessentail-1.0-1.ppc64.rpm"
state: present state: present
register: yum_result register: yum_result
ignore_errors: yes ignore_errors: yes
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
ignore_errors: yes ignore_errors: yes
@ -348,27 +348,27 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- name: Make sure latest foo is installed - name: Make sure latest dinginessentail is installed
yum: yum:
name: foo name: dinginessentail
state: latest state: latest
- name: Downgrade foo using rpm file - name: Downgrade dinginessentail using rpm file
yum: yum:
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm" name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
state: present state: present
allow_downgrade: yes allow_downgrade: yes
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -378,35 +378,35 @@
- "'results' in yum_result" - "'results' in yum_result"
# ============================================================================ # ============================================================================
- block: - block:
- name: make sure foo is not installed - name: make sure dinginessentail is not installed
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
- name: install foo both archs - name: install dinginessentail both archs
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: with_items:
- "{{ repodir }}/foo-1.1-1.x86_64.rpm" - "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm"
- "{{ repodir_i686 }}/foo-1.1-1.i686.rpm" - "{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
- name: try to install lower version of foo from rpm file, without allow_downgrade, just one arch - name: try to install lower version of dinginessentail from rpm file, without allow_downgrade, just one arch
yum: yum:
name: "{{ repodir_i686 }}/foo-1.0-1.i686.rpm" name: "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
state: present state: present
register: yum_result register: yum_result
- name: check foo with rpm - name: check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: verify installation - name: verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout_lines[0].startswith('foo-1.1-1')" - "rpm_result.stdout_lines[0].startswith('dinginessentail-1.1-1')"
- "rpm_result.stdout_lines[1].startswith('foo-1.1-1')" - "rpm_result.stdout_lines[1].startswith('dinginessentail-1.1-1')"
- name: verify yum module outputs - name: verify yum module outputs
assert: assert:
@ -417,35 +417,35 @@
when: ansible_architecture == "x86_64" when: ansible_architecture == "x86_64"
# ============================================================================ # ============================================================================
- block: - block:
- name: make sure foo is not installed - name: make sure dinginessentail is not installed
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
- name: install foo both archs - name: install dinginessentail both archs
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: with_items:
- "{{ repodir }}/foo-1.0-1.x86_64.rpm" - "{{ repodir }}/dinginessentail-1.0-1.x86_64.rpm"
- "{{ repodir_i686 }}/foo-1.0-1.i686.rpm" - "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
- name: Update both arch in one task using rpm files - name: Update both arch in one task using rpm files
yum: yum:
name: "{{ repodir }}/foo-1.1-1.x86_64.rpm,{{ repodir_i686 }}/foo-1.1-1.i686.rpm" name: "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm,{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
state: present state: present
register: yum_result register: yum_result
- name: check foo with rpm - name: check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: verify installation - name: verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout_lines[0].startswith('foo-1.1-1')" - "rpm_result.stdout_lines[0].startswith('dinginessentail-1.1-1')"
- "rpm_result.stdout_lines[1].startswith('foo-1.1-1')" - "rpm_result.stdout_lines[1].startswith('dinginessentail-1.1-1')"
- name: verify yum module outputs - name: verify yum module outputs
assert: assert:
@ -458,28 +458,28 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
# FIXME: dnf currently doesn't support epoch as part of it's pkg_spec for # FIXME: dnf currently doesn't support epoch as part of it's pkg_spec for
# finding install candidates # finding install candidates
# https://bugzilla.redhat.com/show_bug.cgi?id=1619687 # https://bugzilla.redhat.com/show_bug.cgi?id=1619687
- block: - block:
- name: Install 1:foo-1.0-2 - name: Install 1:dinginessentail-1.0-2
yum: yum:
name: "1:foo-1.0-2.{{ ansible_architecture }}" name: "1:dinginessentail-1.0-2.{{ ansible_architecture }}"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -490,7 +490,7 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
when: ansible_pkg_mgr == 'yum' when: ansible_pkg_mgr == 'yum'
@ -505,21 +505,21 @@
# upstreams # upstreams
- block: - block:
# ============================================================================ # ============================================================================
- name: Install foo-1.0-2 - name: Install dinginessentail-1.0-2
yum: yum:
name: "foo-1.0-2.{{ ansible_architecture }}" name: "dinginessentail-1.0-2.{{ ansible_architecture }}"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -528,21 +528,21 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
- name: Install foo-1.0-2 again - name: Install dinginessentail-1.0-2 again
yum: yum:
name: foo-1.0-2 name: dinginessentail-1.0-2
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "not yum_result.changed" - "not yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-2')" - "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -553,27 +553,27 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
when: not (ansible_distribution == "Fedora" and ansible_distribution_major_version|int < 26) when: not (ansible_distribution == "Fedora" and ansible_distribution_major_version|int < 26)
# https://github.com/ansible/ansible/issues/47689 # https://github.com/ansible/ansible/issues/47689
- block: - block:
- name: Install foo == 1.0 - name: Install dinginessentail == 1.0
yum: yum:
name: "foo == 1.0" name: "dinginessentail == 1.0"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0-1')" - "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -584,7 +584,7 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
when: ansible_pkg_mgr == 'yum' when: ansible_pkg_mgr == 'yum'
@ -592,37 +592,37 @@
# https://github.com/ansible/ansible/pull/54603 # https://github.com/ansible/ansible/pull/54603
- block: - block:
- name: Install foo < 1.1 - name: Install dinginessentail < 1.1
yum: yum:
name: "foo < 1.1" name: "dinginessentail < 1.1"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.0')" - "rpm_result.stdout.startswith('dinginessentail-1.0')"
- name: Install foo >= 1.1 - name: Install dinginessentail >= 1.1
yum: yum:
name: "foo >= 1.1" name: "dinginessentail >= 1.1"
state: present state: present
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify installation - name: Verify installation
assert: assert:
that: that:
- "yum_result.changed" - "yum_result.changed"
- "rpm_result.stdout.startswith('foo-1.1')" - "rpm_result.stdout.startswith('dinginessentail-1.1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -634,50 +634,50 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo name: dinginessentail
state: absent state: absent
when: ansible_pkg_mgr == 'yum' when: ansible_pkg_mgr == 'yum'
# https://github.com/ansible/ansible/issues/45250 # https://github.com/ansible/ansible/issues/45250
- block: - block:
- name: Install foo-1.0, foo-bar-1.0, bar-1.0 - name: Install dinginessentail-1.0, dinginessentail-olive-1.0, landsidescalping-1.0
yum: yum:
name: "foo-1.0,foo-bar-1.0,bar-1.0" name: "dinginessentail-1.0,dinginessentail-olive-1.0,landsidescalping-1.0"
state: present state: present
- name: Upgrade foo* - name: Upgrade dinginessentail*
yum: yum:
name: foo* name: dinginessentail*
state: latest state: latest
register: yum_result register: yum_result
- name: Check foo with rpm - name: Check dinginessentail with rpm
shell: rpm -q foo shell: rpm -q dinginessentail
register: rpm_result register: rpm_result
- name: Verify update of foo - name: Verify update of dinginessentail
assert: assert:
that: that:
- "rpm_result.stdout.startswith('foo-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
- name: Check foo-bar with rpm - name: Check dinginessentail-olive with rpm
shell: rpm -q foo-bar shell: rpm -q dinginessentail-olive
register: rpm_result register: rpm_result
- name: Verify update of foo-bar - name: Verify update of dinginessentail-olive
assert: assert:
that: that:
- "rpm_result.stdout.startswith('foo-bar-1.1-1')" - "rpm_result.stdout.startswith('dinginessentail-olive-1.1-1')"
- name: Check bar with rpm - name: Check landsidescalping with rpm
shell: rpm -q bar shell: rpm -q landsidescalping
register: rpm_result register: rpm_result
- name: Verify bar did NOT get updated - name: Verify landsidescalping did NOT get updated
assert: assert:
that: that:
- "rpm_result.stdout.startswith('bar-1.0-1')" - "rpm_result.stdout.startswith('landsidescalping-1.0-1')"
- name: Verify yum module outputs - name: Verify yum module outputs
assert: assert:
@ -689,5 +689,5 @@
always: always:
- name: Clean up - name: Clean up
yum: yum:
name: foo,foo-bar,bar name: dinginessentail,dinginessentail-olive,landsidescalping
state: absent state: absent