From e43687ec0dfa5d9e5d5eddf1f8cbbbcf9355017f Mon Sep 17 00:00:00 2001 From: Sam Hague Date: Fri, 14 Sep 2018 15:12:34 -0400 Subject: [PATCH] Ignore ssh errors on closed connections Commit I7bb0f566eef9c4e5526272a2af567d0180db8e09 brought in a change to logout from ssh connections, but in some cases the connection is gone, such as during stop and start of ODL nodes in clustering tests. This then fails the keyword and exits so the later part of the keyword doesn't execute. And that is the important part which opens a new connection. This ends up leaving the old connection which is closed and unusable. Change-Id: I3512686e7df117c453789608bc5c3b2121e7c7b8 Signed-off-by: Sam Hague --- csit/libraries/KarafKeywords.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csit/libraries/KarafKeywords.robot b/csit/libraries/KarafKeywords.robot index 1c39b72adb..b96599519a 100644 --- a/csit/libraries/KarafKeywords.robot +++ b/csit/libraries/KarafKeywords.robot @@ -140,8 +140,8 @@ Open_Controller_Karaf_Console_On_Background BuiltIn.Log ${member_index} ${status} ${old_connection_index} = BuiltIn.Run_Keyword_And_Ignore_Error Get From Dictionary ${connection_index_dict} ${member_index} BuiltIn.Run_Keyword_If '${status}'=='PASS' BuiltIn.Run_Keywords SSHLibrary.Switch_Connection ${old_connection_index} - ... AND SSHLibrary.Write logout - ... AND SSHLibrary.Close_Connection + ... AND BuiltIn.Run_Keyword_And_Ignore_Error SSHLibrary.Write logout + ... AND BuiltIn.Run_Keyword_And_Ignore_Error SSHLibrary.Close_Connection ${odl_ip} = ClusterManagement.Resolve_IP_Address_For_Member ${member_index} SSHLibrary.Open_Connection ${odl_ip} port=${KARAF_SHELL_PORT} prompt=${KARAF_PROMPT_LOGIN} timeout=${timeout} ${karaf_connection_object} = SSHLibrary.Get_Connection -- 2.36.6