blob: 8d7246f830cc64a5f75293443740a16bd7d213e2 [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
causten147f5752016-08-11 16:24:45 -05005Force Tags chassisboot
George Keishingeefc07a2016-07-26 03:25:35 -05006
7Test template power on tests
8
9*** variables ***
10
11${POWER_CONTROL} /org/openbmc/control/chassis0/
12${POWER_SETTING} /org/openbmc/settings/host0
13${Retry} 1 min
14${Interval} 30s
15
16*** test cases ***
17
18Verify power on system states
19
20 # Template Action Expected End State
21 poweroff HOST_POWERED_OFF
22 poweron HOST_POWERED_ON
23 poweroff HOST_POWERED_OFF
24
25*** keywords ***
26
27power on tests
28 [Arguments] ${action} ${endState}
29 Log To Console ${\n}${action} the host
30
31 @{arglist}= Create List
32 ${args}= Create Dictionary data=@{arglist}
33 ${resp}= Call Method ${POWER_CONTROL} ${action} data=${args}
34 should be equal as strings ${resp.status_code} ${HTTP_OK}
35 ${json} = to json ${resp.content}
36 should be equal as strings ${json['status']} ok
37
38 Wait Until Keyword Succeeds ${Retry} ${Interval}
39 ... system power state ${endState}
40
41
42system power state
43 [Arguments] ${endState}
44 ${currState}= Read Attribute ${POWER_SETTING} system_state
45 Should be equal ${currState} ${endState}