Migrate Linux CI roles to test targets. (#17997)

This commit is contained in:
Matt Clay 2016-10-13 09:09:25 -07:00 committed by GitHub
commit 75e4645ee7
263 changed files with 53 additions and 53 deletions

View file

@ -0,0 +1,2 @@
dependencies:
- prepare_tests

View file

@ -0,0 +1,22 @@
# test code for the zypper repository module
#
# (c) 2016, Guido Günther <agx@sigxcpu.org>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- include: 'zypper_repository.yml'
when: ansible_os_family == 'Suse'

View file

@ -0,0 +1,143 @@
---
- name: ensure zypper ref works
command: zypper -n ref
- name: Delete
zypper_repository:
name: test
state: absent
register: zypper_result
- name: Add repo
zypper_repository:
name: test
state: present
repo: http://dl.google.com/linux/chrome/rpm/stable/x86_64
register: zypper_result
- debug: var=zypper_result
- name: verify repo addition
assert:
that:
- "zypper_result.changed"
- name: Add repo again
zypper_repository:
name: test
state: present
repo: http://dl.google.com/linux/chrome/rpm/stable/x86_64
register: zypper_result
- name: verify no change on second install
assert:
that:
- "not zypper_result.changed"
- name: Change repo URL
zypper_repository:
name: test
state: present
repo: http://download.videolan.org/pub/vlc/SuSE/Leap_42.1/
register: zypper_result
- name: Verify change on URL only change
assert:
that:
- "zypper_result.changed"
- name: Remove repo by name (also to not mess up later tasks)
zypper_repository:
name: test
state: absent
- 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_result1
ignore_errors: yes
- name: check repo is updated by url
command: zypper lr oss2
register: zypper_result2
- assert:
that:
- "zypper_result1.rc == 6"
- "'not found' in zypper_result1.stderr"
- "zypper_result2.rc == 0"
- "'http://download.opensuse.org/distribution/leap/42.1/repo/oss/' in zypper_result2.stdout"
- name: reset oss repo (to not break zypper later)
zypper_repository:
name: OSS
state: present
repo: http://download.opensuse.org/distribution/leap/42.1/repo/oss/
priority: 99
refresh: yes
- name: add two repos with same name
zypper_repository:
name: samename
state: present
repo: "{{ item }}"
with_items:
- http://download.opensuse.org/repositories/science/openSUSE_Leap_42.1/
- http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_42.1/
- name: check repo is updated by name
command: zypper lr samename
register: zypper_result
- assert:
that:
- "'/science/' not in zypper_result.stdout"
- "'/devel:/languages:/python/' in zypper_result.stdout"
- name: remove last added repos (by URL to test that)
zypper_repository:
repo: http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_42.1/
state: absent
- name: ensure zypper ref still works
command: zypper -n ref