Adding support for BMC Power On/BMC Power Off
This change includes the following new keywords:
BMC Power On
Check Power On States
BMC Power Off
Check Power Off States
Get BMC State
Get Power State
It also includes modifications to the following keywods:
Is Power On
Is Power Off
Wait For Host To Ping
Check OS
Open Connection and Log In
A variable definition has been added to resource.txt and a
file to keep track of DVT's resource files has been created.
Change-Id: Idc81be7e2dfb21c35bc51214f8650a10d8481120
Signed-off-by: Leah McNutt <lmcnutt@us.ibm.com>
diff --git a/lib/connection_client.robot b/lib/connection_client.robot
index 2cc8413..b67996c 100755
--- a/lib/connection_client.robot
+++ b/lib/connection_client.robot
@@ -4,18 +4,54 @@
Library SSHLibrary
Library OperatingSystem
+Library Collections
*** Variables ***
*** Keywords ***
Open Connection And Log In
- Run Keyword If '${SSH_PORT}' != '${EMPTY}' and '${HTTPS_PORT}' != '${EMPTY}'
+ [Documentation] Opens a connection with the given arguments, and logs in.
+ ... Defaults to logging into the BMC.
+ [Arguments] ${username}=${OPENBMC_USERNAME}
+ ... ${password}=${OPENBMC_PASSWORD} &{connection_args}
+
+ # username The username to log into the connection with.
+ # password The password to log into the connection with.
+ # connection_args A dictionary of acceptable inputs to the Open Connection
+ # keyword. This includes, but is not limited to, the
+ # following:
+ # host, alias, port, timeout, newline, prompt, term_type,
+ # width, height, path_separator, endcoding
+ # (For more information, please visit the SSHLibrary doc)
+
+ # Of the above arguments to Open Connection, this keyword
+ # will provide the following default values:
+ # host ${OPENBMC_HOST}
+
+ # If no host was provided, add ${OPENBMC_HOST} to the dictionary
+ ${has_host}= Run Keyword and Return Status
+ ... Dictionary Should Contain Key ${connection_args} host
+ Run Keyword If ${has_host} == ${FALSE}
+ ... Set To Dictionary ${connection_args} host=${OPENBMC_HOST}
+
+ Run Keyword If
+ ... '${SSH_PORT}' != '${EMPTY}' and '${HTTPS_PORT}' != '${EMPTY}'
... User input SSH and HTTPs Ports
- Run Keyword If '${SSH_PORT}' == '${EMPTY}' Open connection ${OPENBMC_HOST}
- ... ELSE Run Keyword Open connection ${OPENBMC_HOST} port=${SSH_PORT}
+ # Check to see if a port to connect to was provided.
+ ${has_port}= Run Keyword and Return Status
+ ... Dictionary Should Contain Key ${connection_args} port
- Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+ # If the ${SSH_PORT} is set and no port was provided, add the defined port
+ # to the dictionary and open the connection. Otherwise, open the connection
+ # with the either the provided port or the default port.
+ Run Keyword If '${SSH_PORT}' != '${EMPTY}' and ${has_port} == ${FALSE}
+ ... Run Keywords
+ ... Set To Dictionary ${connection_args} port=${SSH_PORT} AND
+ ... Open connection &{connection_args}
+ ... ELSE Run Keyword Open connection &{connection_args}
+
+ Login ${username} ${password}
User input SSH and HTTPs Ports
[Documentation] Update the global SSH and HTTPs port variable for QEMU