Debian Codegraph @

test/integration/targets/ping/tasks/main.yml

raw
1 # test code for the ping module
2 # (c) 2014, James Cammarata <[email protected]>
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: ping the test
20 ping:
21 register: result
22
23 - name: assert the ping worked
24 assert:
25 that:
26 - result is not failed
27 - result is not changed
28 - result.ping == 'pong'
29
30 - name: ping with data
31 ping:
32 data: testing
33 register: result
34
35 - name: assert the ping worked with data
36 assert:
37 that:
38 - result is not failed
39 - result is not changed
40 - result.ping == 'testing'
41
42 - name: ping with data=crash
43 ping:
44 data: crash
45 register: result
46 ignore_errors: yes
47
48 - name: assert the ping failed with data=boom
49 assert:
50 that:
51 - result is failed
52 - result is not changed
53 - result.msg is match 'Task failed. Module failed. boom'