Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 2 | Documentation Synaccess Protocol Distribution Unit (PDU) library |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 3 | |
| 4 | Resource ../../lib/pdu/pdu.robot |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 5 | Library RequestsLibrary |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 6 | |
| 7 | *** Keywords *** |
| 8 | Connect and Login |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 9 | [Documentation] Open PDU connection and login. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | Validate Prereq |
Michael Walsh | e21c364 | 2017-03-21 14:52:21 -0500 | [diff] [blame] | 11 | SSHLibrary.Open Connection ${PDU_IP} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 12 | ${auth}= Create List ${PDU_USERNAME} ${PDU_PASSWORD} |
| 13 | Create Session pdu http://${PDU_IP} auth=${auth} |
| 14 | |
| 15 | Power Cycle |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 16 | [Documentation] Perform PDU power cycle. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | Connect and Login |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 18 | ${resp}= GET On Session pdu /cmd.cgi?$A4 ${PDU_SLOT_NO} |
George Keishing | 7424e82 | 2022-07-18 11:48:34 -0500 | [diff] [blame] | 19 | |
Steven Sombar | ac831df | 2018-01-18 07:28:52 -0600 | [diff] [blame] | 20 | ${error_message}= Catenate Power cycle of slot ${PDU_SLOT_NO} failed. |
George Keishing | 7424e82 | 2022-07-18 11:48:34 -0500 | [diff] [blame] | 21 | ... PDU returned RC=${resp}. |
| 22 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} msg=${error_message} |