mirror of https://github.com/ansible/ansible.git
Add apt test role
parent
50e5d81777
commit
2b3856f1b6
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- prepare_tests
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
# UNINSTALL
|
||||||
|
- name: uninstall wget with apt
|
||||||
|
apt: pkg=wget state=absent purge=yes
|
||||||
|
register: apt_result
|
||||||
|
|
||||||
|
- name: check wget with dpkg
|
||||||
|
shell: dpkg --get-selections | fgrep wget
|
||||||
|
failed_when: False
|
||||||
|
register: dpkg_result
|
||||||
|
|
||||||
|
- debug: var=apt_result
|
||||||
|
- debug: var=dpkg_result
|
||||||
|
|
||||||
|
- name: verify uninstallation of wget
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "'changed' in apt_result"
|
||||||
|
- "dpkg_result.rc == 1"
|
||||||
|
|
||||||
|
# INSTALL
|
||||||
|
- name: install wget with apt
|
||||||
|
apt: name=wget state=present
|
||||||
|
register: apt_result
|
||||||
|
|
||||||
|
- name: check wget with dpkg
|
||||||
|
shell: dpkg --get-selections | fgrep wget
|
||||||
|
failed_when: False
|
||||||
|
register: dpkg_result
|
||||||
|
|
||||||
|
- debug: var=apt_result
|
||||||
|
- debug: var=dpkg_result
|
||||||
|
|
||||||
|
- name: verify installation of wget
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "apt_result.changed"
|
||||||
|
- "dpkg_result.rc == 0"
|
||||||
|
|
||||||
|
- name: verify apt module outputs
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "'invocation' in apt_result"
|
||||||
|
- "'changed' in apt_result"
|
||||||
|
- "'item' in apt_result"
|
||||||
|
- "'stderr' in apt_result"
|
||||||
|
- "'stdout' in apt_result"
|
||||||
|
- "'stdout_lines' in apt_result"
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
# test code for the yum module
|
||||||
|
# (c) 2014, James Tanner <tanner.jc@gmail.com>
|
||||||
|
|
||||||
|
# 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: 'apt.yml'
|
||||||
|
when: ansible_distribution in ('Ubuntu', 'Debian')
|
||||||
|
|
||||||
Loading…
Reference in New Issue