2017-02-27 11:36:52 +00:00
|
|
|
# test code for the win_chocolatey module
|
|
|
|
# (c) 2017, Dag Wieers <dag@wieers.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/>.
|
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: simple failure smoke test # NB: this is the only test that runs under shippable until others can use non-internet endpoints
|
2017-02-27 11:36:52 +00:00
|
|
|
win_chocolatey:
|
2017-07-13 01:38:34 +00:00
|
|
|
register: choco_fail
|
|
|
|
failed_when: "not choco_fail.msg | regex_search('Missing required argument: name')"
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- when: lookup('env', 'ANSIBLE_TEST_CI') != 'shippable'
|
|
|
|
block:
|
|
|
|
- name: install sysinternals
|
|
|
|
win_chocolatey:
|
|
|
|
name: sysinternals
|
|
|
|
state: present
|
|
|
|
register: install_sysinternals
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: verify install sysinternals
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'install_sysinternals.changed == true'
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: install sysinternals again
|
|
|
|
win_chocolatey:
|
|
|
|
name: sysinternals
|
|
|
|
state: present
|
|
|
|
register: install_sysinternals_again
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: verify install sysinternals again
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'install_sysinternals_again.changed == false'
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: remove sysinternals
|
|
|
|
win_chocolatey:
|
|
|
|
name: sysinternals
|
|
|
|
state: absent
|
|
|
|
register: remove_sysinternals
|
2017-02-27 11:36:52 +00:00
|
|
|
|
2017-07-13 01:38:34 +00:00
|
|
|
- name: verify remove sysinternals
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'remove_sysinternals.changed == true'
|
|
|
|
|
|
|
|
- name: remove sysinternals again
|
|
|
|
win_chocolatey:
|
|
|
|
name: sysinternals
|
|
|
|
state: absent
|
|
|
|
register: remove_sysinternals_again
|
|
|
|
|
|
|
|
- name: verify remove sysinternals again
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'remove_sysinternals_again.changed == false'
|