Enable Qemu test execution
This change addresses the following
- user input SSH and HTTPS port
- consolidate SSH connections in lib
- fix obsolete codes
- update README instructions
Resolves openbmc/openbmc-test-automation#41
Change-Id: I06dd132fb745ebbf035cb0fc583b46542448d126
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/connection_client.robot b/lib/connection_client.robot
new file mode 100755
index 0000000..1e74357
--- /dev/null
+++ b/lib/connection_client.robot
@@ -0,0 +1,26 @@
+*** Settings ***
+Documentation This module is for SSH connection override to QEMU
+... based openbmc systems.
+
+Library SSHLibrary
+Library OperatingSystem
+
+*** Variables ***
+
+*** Keywords ***
+Open Connection And Log In
+ 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}
+
+ Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+
+User input SSH and HTTPs Ports
+ [Documentation] Update the global SSH and HTTPs port variable for QEMU
+ ${port_num}= Convert To Integer ${SSH_PORT}
+ ${SSH_PORT}= Replace Variables ${port_num}
+
+ ${https_num}= Convert To Integer ${HTTPS_PORT}
+ ${AUTH_URI}= Replace Variables https://${OPENBMC_HOST}:${https_num}