1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add tests for yum module taking lists of packages in various formats

This commit is contained in:
Toshio Kuratomi 2015-04-21 10:08:00 -07:00
parent 7669a0b275
commit 6935d467eb

View file

@ -28,7 +28,7 @@
- debug: var=yum_result - debug: var=yum_result
- debug: var=rpm_result - debug: var=rpm_result
- name: verify uninstalltion of sos - name: verify uninstallation of sos
assert: assert:
that: that:
- "yum_result.rc == 0" - "yum_result.rc == 0"
@ -73,7 +73,7 @@
- "'rc' in yum_result" - "'rc' in yum_result"
- "'results' in yum_result" - "'results' in yum_result"
# INSTALL AGAIN # INSTALL AGAIN
- name: install sos again - name: install sos again
yum: name=sos state=present yum: name=sos state=present
register: yum_result register: yum_result
@ -83,4 +83,106 @@
that: that:
- "not yum_result.changed" - "not yum_result.changed"
# Multiple packages
- name: uninstall sos and python-q
yum: name=sos,python-q state=removed
register: yum_result
- name: check sos with rpm
shell: rpm -q sos
failed_when: False
register: rpm_sos_result
- name: check python-q with rpm
shell: rpm -q python-q
failed_when: False
register: rpm_python_q_result
- name: verify packages installed
assert:
that:
- "rpm_sos_result.rc != 0"
- "rpm_python_q_result.rc != 0"
- name: install sos and python-q as comma separated
yum: name=sos,python-q state=present
register: yum_result
- name: check sos with rpm
shell: rpm -q sos
failed_when: False
register: rpm_sos_result
- name: check python-q with rpm
shell: rpm -q python-q
failed_when: False
register: rpm_python_q_result
- name: verify packages installed
assert:
that:
- "yum_result.rc == 0"
- "yum_result.changed"
- "rpm_sos_result.rc == 0"
- "rpm_python_q_result.rc == 0"
- name: uninstall sos and python-q
yum: name=sos,python-q state=removed
register: yum_result
- name: install sos and python-q as list
yum:
name:
- sos
- python-q
state: present
register: yum_result
- name: check sos with rpm
shell: rpm -q sos
failed_when: False
register: rpm_sos_result
- name: check python-q with rpm
shell: rpm -q python-q
failed_when: False
register: rpm_python_q_result
- name: verify packages installed
assert:
that:
- "yum_result.rc == 0"
- "yum_result.changed"
- "rpm_sos_result.rc == 0"
- "rpm_python_q_result.rc == 0"
- name: uninstall sos and python-q
yum: name=sos,python-q state=removed
register: yum_result
- name: install sos and python-q as comma separated with spaces
yum:
name: "sos, python-q"
state: present
register: yum_result
- name: check sos with rpm
shell: rpm -q sos
failed_when: False
register: rpm_sos_result
- name: check sos with rpm
shell: rpm -q python-q
failed_when: False
register: rpm_python_q_result
- name: verify packages installed
assert:
that:
- "yum_result.rc == 0"
- "yum_result.changed"
- "rpm_sos_result.rc == 0"
- "rpm_python_q_result.rc == 0"
- name: uninstall sos and python-q
yum: name=sos,python-q state=removed