Debian Codegraph @

ansible_collections/community/windows/tests/integration/targets/win_toast/tasks/tests.yml

raw
1 - name: Warn user
2 win_toast:
3 expire: 10
4 msg: Keep calm and carry on.
5 register: msg_result
6 ignore_errors: True
7
8 - name: Test msg_result when can_toast is true (normal mode, users)
9 assert:
10 that:
11 - msg_result is not failed
12 - msg_result.time_taken > 10
13 when:
14 - can_toast == True
15 - in_check_mode == False
16 - user_count.stdout|int > 0
17
18 - name: Test msg_result when can_toast is true (normal mode, no users)
19 assert:
20 that:
21 - msg_result is not failed
22 - msg_result.time_taken > 0.1
23 - msg_result.toast_sent == False
24 when:
25 - can_toast == True
26 - in_check_mode == False
27 - user_count.stdout|int == 0
28
29 - name: Test msg_result when can_toast is true (check mode, users)
30 assert:
31 that:
32 - msg_result is not failed
33 - msg_result.time_taken > 0.1
34 when:
35 - can_toast == True
36 - in_check_mode == True
37
38 - name: Test msg_result when can_toast is true (check mode, no users)
39 assert:
40 that:
41 - msg_result is not failed
42 - msg_result.time_taken > 0.1
43 - msg_result.toast_sent == False
44 when:
45 - can_toast == True
46 - in_check_mode == True
47 - user_count.stdout|int == 0
48
49 - name: Test msg_result when can_toast is false
50 assert:
51 that:
52 - msg_result is failed
53 when: can_toast == False
54
55 - name: Warn user again
56 win_toast:
57 expire: 10
58 msg: Keep calm and carry on.
59 register: msg_result2
60 ignore_errors: True
61
62 - name: Test msg_result2 when can_toast is true (normal mode, users)
63 assert:
64 that:
65 - msg_result2 is not failed
66 - msg_result2.time_taken > 10
67 when:
68 - can_toast == True
69 - in_check_mode == False
70 - user_count.stdout|int > 0
71
72 - name: Test msg_result2 when can_toast is true (normal mode, no users)
73 assert:
74 that:
75 - msg_result2 is not failed
76 - msg_result2.time_taken > 0.1
77 when:
78 - can_toast == True
79 - in_check_mode == False
80 - user_count.stdout|int == 0
81
82 - name: Test msg_result2 when can_toast is true (check mode, users)
83 assert:
84 that:
85 - msg_result2 is not failed
86 - msg_result2.time_taken > 0.1
87 when:
88 - can_toast == True
89 - in_check_mode == False
90 - user_count.stdout|int > 0
91
92 - name: Test msg_result2 when can_toast is true (check mode, no users)
93 assert:
94 that:
95 - msg_result2 is not failed
96 - msg_result2.time_taken > 0.1
97 when:
98 - can_toast == True
99 - in_check_mode == False
100 - user_count.stdout|int == 0
101
102 - name: Test msg_result2 when can_toast is false
103 assert:
104 that:
105 - msg_result2 is failed
106 when: can_toast == False