blob: f6eb957343eaa9d81f6dbbcd4bfa23f0cc8487b6 [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
George Keishingfbd67002022-08-01 11:24:03 -05005Library RequestsLibrary
Chris Austenb29d2e82016-06-07 12:25:35 -05006
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 Keishingfbd67002022-08-01 11:24:03 -050018 ${resp}= GET On Session pdu /cmd.cgi?$A4 ${PDU_SLOT_NO}
George Keishing7424e822022-07-18 11:48:34 -050019
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}