George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This module will test basic power on use cases for CI |
| 3 | |
| 4 | Resource ../lib/rest_client.robot |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 5 | Force Tags chassisboot |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 6 | |
| 7 | Test 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 | |
| 18 | Verify 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 | |
| 27 | power 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 | |
| 42 | system power state |
| 43 | [Arguments] ${endState} |
| 44 | ${currState}= Read Attribute ${POWER_SETTING} system_state |
| 45 | Should be equal ${currState} ${endState} |