ssh_pw bin path for SOL logging
Traditionally we would need to export path and run robot in
command line. If ssh_pw is not found in the ENV path, then
set the path to current execution bin dir path.
Resolves openbmc/openbmc-test-automation#929
Change-Id: If673056e24d22c6cfe4eaf8602a81459a671f7d7
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 9967beb..851358a 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -504,14 +504,18 @@
Create OS Console Command String
[Documentation] Return a command string to start OS console logging.
+ ${ssh_pw_file_path}= Set Variable ssh_pw
+
# First make sure that the ssh_pw program is available.
${cmd_buf}= Catenate which ssh_pw 2>&1
Rdpissuing ${cmd_buf}
${rc} ${output}= Run And Return Rc And Output ${cmd_buf}
Rdpvars rc output
- Should Be Equal ${rc} ${0} msg=${output}\n
- ${cmd_buf}= Catenate ssh_pw ${OPENBMC_PASSWORD} -p 2200
+ ${ssh_pw_file_path}= Run Keyword If ${rc} != ${0}
+ ... Set Variable ${EXECDIR}${/}bin/ssh_pw
+
+ ${cmd_buf}= Catenate ${ssh_pw_file_path} ${OPENBMC_PASSWORD} -p 2200
... -o "StrictHostKeyChecking no" ${OPENBMC_USERNAME}@${OPENBMC_HOST}
[Return] ${cmd_buf}