1b29d2e84SChris Austen*** Settings ***
2f4a807bfSJoy OnyerikwuDocumentation           Synaccess Protocol Distribution Unit (PDU) library
3b29d2e84SChris Austen
4b29d2e84SChris AustenResource        ../../lib/pdu/pdu.robot
5*fbd67007SGeorge KeishingLibrary         RequestsLibrary
6b29d2e84SChris Austen
7b29d2e84SChris Austen*** Keywords ***
8b29d2e84SChris AustenConnect and Login
9f4a807bfSJoy Onyerikwu    [Documentation]  Open PDU connection and login.
10b29d2e84SChris Austen    Validate Prereq
11e21c364eSMichael Walsh    SSHLibrary.Open Connection  ${PDU_IP}
12b29d2e84SChris Austen    ${auth}=    Create List     ${PDU_USERNAME}    ${PDU_PASSWORD}
13b29d2e84SChris Austen    Create Session    pdu    http://${PDU_IP}   auth=${auth}
14b29d2e84SChris Austen
15b29d2e84SChris AustenPower Cycle
16f4a807bfSJoy Onyerikwu    [Documentation]  Perform PDU power cycle.
17b29d2e84SChris Austen    Connect and Login
18*fbd67007SGeorge Keishing    ${resp}=  GET On Session  pdu  /cmd.cgi?$A4 ${PDU_SLOT_NO}
197424e823SGeorge Keishing
20ac831dffSSteven Sombar    ${error_message}=  Catenate  Power cycle of slot ${PDU_SLOT_NO} failed.
217424e823SGeorge Keishing    ...  PDU returned RC=${resp}.
227424e823SGeorge Keishing    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}  msg=${error_message}
23