blob: 6a4d1a2cb9f0e582c8f19ff87bed1e29b5c55a13 [file] [log] [blame]
George Keishingeefc07a2016-07-26 03:25:35 -05001*** Settings ***
2Documentation This module will test basic power on use cases for CI
3
4Resource ../lib/rest_client.robot
5
6Test template power on tests
7
8*** variables ***
9
10${POWER_CONTROL} /org/openbmc/control/chassis0/
11${POWER_SETTING} /org/openbmc/settings/host0
12${Retry} 1 min
13${Interval} 30s
14
15*** test cases ***
16
17Verify power on system states
18
19 # Template Action Expected End State
20 poweroff HOST_POWERED_OFF
21 poweron HOST_POWERED_ON
22 poweroff HOST_POWERED_OFF
23
24*** keywords ***
25
26power on tests
27 [Arguments] ${action} ${endState}
28 Log To Console ${\n}${action} the host
29
30 @{arglist}= Create List
31 ${args}= Create Dictionary data=@{arglist}
32 ${resp}= Call Method ${POWER_CONTROL} ${action} data=${args}
33 should be equal as strings ${resp.status_code} ${HTTP_OK}
34 ${json} = to json ${resp.content}
35 should be equal as strings ${json['status']} ok
36
37 Wait Until Keyword Succeeds ${Retry} ${Interval}
38 ... system power state ${endState}
39
40
41system power state
42 [Arguments] ${endState}
43 ${currState}= Read Attribute ${POWER_SETTING} system_state
44 Should be equal ${currState} ${endState}