Ignore ssh errors on closed connections 99/76099/2
authorSam Hague <shague@redhat.com>
Fri, 14 Sep 2018 19:12:34 +0000 (15:12 -0400)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 14 Sep 2018 20:09:12 +0000 (20:09 +0000)
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 <shague@redhat.com>
csit/libraries/KarafKeywords.robot

index 1c39b72adb0caf047d37b99fd60e969967706fad..b96599519a8b871ddb325cb0f212ff664032f024 100644 (file)
@@ -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