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

extend integration test for zypper_repository (#15387)

* include options refresh and priority introduced in ansible/ansible-modules-extras#1990
* test repo update both based on name and URL
* run on all suse flavors
* test overwriting repos by url or name
This commit is contained in:
Robin Roth 2016-04-21 20:10:29 +02:00 committed by René Moser
parent 772d659929
commit 7a4e4c2b02
2 changed files with 69 additions and 1 deletions

View file

@ -18,5 +18,5 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- include: 'zypper_repository.yml'
when: ansible_distribution in ['SLES', 'openSUSE']
when: ansible_os_family == 'Suse'

View file

@ -41,3 +41,71 @@
assert:
that:
- "zypper_result.changed"
- name: use refresh option
zypper_repository:
name: testrefresh
refresh: no
state: present
repo: http://download.opensuse.org/distribution/leap/42.1/repo/oss/
- name: check refreshoption
command: zypper -x lr testrefresh
register: zypper_result
- assert:
that:
- '"autorefresh=\"0\"" in zypper_result.stdout'
- name: set repo priority
zypper_repository:
name: testprio
priority: 55
state: present
repo: http://download.opensuse.org/distribution/leap/42.1/repo/oss/
- name: check refreshoption
command: zypper -x lr testprio
register: zypper_result
- assert:
that:
- '"priority=\"55\"" in zypper_result.stdout'
- name: add two repos with same url
zypper_repository:
name: "{{item}}"
state: present
repo: http://download.opensuse.org/distribution/leap/42.1/repo/oss/
with_items:
- oss1
- oss2
- name: check repo is updated by url
command: zypper lr oss1
register: zypper_result
ignore_errors: yes
- assert:
that:
- "zypper_result.rc == 6"
- "'not found' in zypper_result.stderr"
- name: add two repos with same name
zypper_repository:
name: samename
state: present
repo: "http://download.opensuse.org/distribution/leap/42.1/repo/{{item}}/"
with_items:
- oss
- non-oss
- name: check repo is updated by name
command: zypper lr samename
register: zypper_result
- assert:
that:
- "'/oss/' not in zypper_result.stdout"
- "'/non-oss/' in zypper_result.stdout"