Clear system entries in known-hosts file
Resolves openbmc/openbmc-test-automation#996
Change-Id: I7ecc4361788975dc985104eade782bc7583f3795
Signed-off-by: Vijay Kantanavar <vikantan@in.ibm.com>
diff --git a/lib/connection_client.robot b/lib/connection_client.robot
index 7e88882..dc8834d 100755
--- a/lib/connection_client.robot
+++ b/lib/connection_client.robot
@@ -134,3 +134,10 @@
# If no connections are found, open a connection with the provided args.
Log No connection with provided arguments. Opening a connection.
Open Connection and Log In &{connection_args}
+
+
+Clear System Entry From Knownhosts
+ [Documentation] Delete OPENBMC_HOST entry from known_hosts file.
+ ${cmd}= Set Variable sed '/${OPENBMC_HOST}/d' -i ~/.ssh/known_hosts
+ ${rc} ${output}= Run and Return RC and Output ${cmd}
+
diff --git a/tests/__init__.robot b/tests/__init__.robot
index 2ff43e2..c5c2f99 100644
--- a/tests/__init__.robot
+++ b/tests/__init__.robot
@@ -17,6 +17,7 @@
System Driver Data
[Documentation] System driver information.
+ Run Keyword And Ignore Error Clear System Entry From Knownhosts
Open Connection And Log In
Run Keyword And Ignore Error Log BMC Driver Details
Run Keyword And Ignore Error Log PNOR Driver Details