| 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 | 
 | 5 | Library         RequestsLibrary.RequestsKeywords | 
 | 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 | 
 | 18 |     ${ret}=    Get Request    pdu    /cmd.cgi?$A4 ${PDU_SLOT_NO} | 
| Steven Sombar | ac831df | 2018-01-18 07:28:52 -0600 | [diff] [blame] | 19 |     ${error_message}=  Catenate  Power cycle of slot ${PDU_SLOT_NO} failed. | 
 | 20 |     ...  PDU returned RC=${ret}. | 
 | 21 |     Should Be Equal As Strings  ${ret}  ${HTTP_OK}  msg=${error_message} |