summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/wakeonlan/tasks/main.yml
blob: f920ccacfe48960027f97129c3a31a466eaaa182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- name: Send a magic Wake-on-LAN packet to 00:00:5E:00:53:66
  wakeonlan:
    mac: 00:00:5E:00:53:66
    broadcast: 192.0.2.255

- name: Send a magic Wake-on-LAN packet on port 9 to 00-00-5E-00-53-66
  wakeonlan:
    mac: 00-00-5E-00-53-66
    port: 9

- name: Provide an incorrect MAC length
  wakeonlan:
    mac: 00-00-5E-00-53-66-AB
    port: 9
  ignore_errors: yes
  register: incorrect_mac_length

- name: Check error message
  assert:
    that:
    - incorrect_mac_length is failed
    - incorrect_mac_length.msg is search('Incorrect MAC address length')

- name: Provide an incorrect MAC format
  wakeonlan:
    mac: ZW-YX-WV-UT-SR-QP
    port: 9
  ignore_errors: yes
  register: incorrect_mac_format

- name: Check error message
  assert:
    that:
    - incorrect_mac_format is failed
    - incorrect_mac_format.msg is search('Incorrect MAC address format')

- name: Cause a socket error
  wakeonlan:
    mac: 00-00-5E-00-53-66
    broadcast: 345.567.678.890
  ignore_errors: yes
  register: incorrect_broadcast_address

- name: Check error message
  assert:
    that:
    - incorrect_broadcast_address is failed
    - incorrect_broadcast_address.msg is search('not known')