PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test/integration/roles/test_win_ping/tasks/main.yml

https://github.com/ajanthanm/ansible
YAML | 72 lines | 27 code | 12 blank | 33 comment | 0 complexity | 3182d026a1124cd0b78eae81e9928bfe MD5 | raw file
 1# test code for the win_ping module
 2# (c) 2014, Chris Church <chris@ninemoreminutes.com>
 3
 4# This file is part of Ansible
 5#
 6# Ansible is free software: you can redistribute it and/or modify
 7# it under the terms of the GNU General Public License as published by
 8# the Free Software Foundation, either version 3 of the License, or
 9# (at your option) any later version.
10#
11# Ansible is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
18
19- name: test win_ping
20  action: win_ping
21  register: win_ping_result
22
23- name: check win_ping result
24  assert:
25    that: 
26      - "not win_ping_result|failed"
27      - "not win_ping_result|changed"
28      - "win_ping_result.ping == 'pong'"
29
30- name: test win_ping with data
31  win_ping: data=blah
32  register: win_ping_with_data_result
33
34- name: check win_ping result with data
35  assert:
36    that:
37      - "not win_ping_with_data_result|failed"
38      - "not win_ping_with_data_result|changed"
39      - "win_ping_with_data_result.ping == 'blah'"
40
41#- name: test local ping (should use default ping)
42#  local_action: ping
43#  register: local_ping_result
44
45#- name: check local ping result
46#  assert:
47#    that: 
48#      - "not local_ping_result|failed"
49#      - "not local_ping_result|changed"
50#      - "local_ping_result.ping == 'pong'"
51
52- name: test win_ping.ps1 with data
53  win_ping.ps1: data=bleep
54  register: win_ping_ps1_result
55
56- name: check win_ping.ps1 result with data
57  assert:
58    that: 
59      - "not win_ping_ps1_result|failed"
60      - "not win_ping_ps1_result|changed"
61      - "win_ping_ps1_result.ping == 'bleep'"
62
63#- name: test win_ping with invalid args
64#  win_ping: arg=invalid
65#  register: win_ping_ps1_invalid_args_result
66
67#- name: check that win_ping.ps1 with invalid args fails
68#  assert:
69#    that:
70#      - "win_ping_ps1_invalid_args_result|failed"
71#      - "win_ping_ps1_invalid_args_result.msg"
72