blob: c76553cc85f88f23aca5654c5f58f80133e220a4 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -05002Documentation Synaccess Protocol Distribution Unit (PDU) library
Chris Austenb29d2e82016-06-07 12:25:35 -05003
4Resource ../../lib/pdu/pdu.robot
5Library RequestsLibrary.RequestsKeywords
6
7*** Keywords ***
8Connect and Login
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -05009 [Documentation] Open PDU connection and login.
Chris Austenb29d2e82016-06-07 12:25:35 -050010 Validate Prereq
Michael Walshe21c3642017-03-21 14:52:21 -050011 SSHLibrary.Open Connection ${PDU_IP}
Chris Austenb29d2e82016-06-07 12:25:35 -050012 ${auth}= Create List ${PDU_USERNAME} ${PDU_PASSWORD}
13 Create Session pdu http://${PDU_IP} auth=${auth}
14
15Power Cycle
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -050016 [Documentation] Perform PDU power cycle.
Chris Austenb29d2e82016-06-07 12:25:35 -050017 Connect and Login
George Keishing7424e822022-07-18 11:48:34 -050018 ${resp}= Get Request pdu /cmd.cgi?$A4 ${PDU_SLOT_NO}
19
Steven Sombarac831df2018-01-18 07:28:52 -060020 ${error_message}= Catenate Power cycle of slot ${PDU_SLOT_NO} failed.
George Keishing7424e822022-07-18 11:48:34 -050021 ... PDU returned RC=${resp}.
22 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} msg=${error_message}