Add logout before closing Karaf SSH connection 81/72581/4
authorLuis Gomez <ecelgp@gmail.com>
Fri, 1 Jun 2018 20:08:49 +0000 (13:08 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 1 Jun 2018 21:12:47 +0000 (21:12 +0000)
Not doing this results in a Karaf ssh NPE

See bottom of this log:

https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1
/genius-csit-1node-upstream-all-fluorine/102/odl1_karaf.log.gz

Change-Id: I7bb0f566eef9c4e5526272a2af567d0180db8e09
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
csit/libraries/KarafKeywords.robot

index 749470b7d8b68ed6b93cd30ae622405d5f1b66f1..69549edeca13e460e358a5564fb98162294832a6 100644 (file)
@@ -41,6 +41,7 @@ Issue_Command_On_Karaf_Console
     SSHLibrary.Login    ${KARAF_USER}    ${KARAF_PASSWORD}    loglevel=${loglevel}
     SSHLibrary.Write    ${cmd}
     ${output}    SSHLibrary.Read_Until_Regexp    ${KARAF_PROMPT}
+    SSHLibrary.Write    logout
     SSHLibrary.Close_Connection
     BuiltIn.Log    ${output}
     [Return]    ${output}
@@ -139,6 +140,7 @@ 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
     ${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}
@@ -322,6 +324,7 @@ Wait_For_Karaf_Log
     SSHLibrary.Login    ${KARAF_USER}    ${KARAF_PASSWORD}    loglevel=${loglevel}
     SSHLibrary.Write    log:tail
     SSHLibrary.Read_Until    ${message}
+    SSHLibrary.Write    logout
     SSHLibrary.Close_Connection
 
 Restart_Bundle