When the Connect_To_ODL_Netconf keyword fails for any reason,
the Close_ODL_Netconf_Connection in teardown crashes,
flagging all tests as failed. Avoid that by checking that
there indeed is an ODL Netconf connection to be closed before
trying to do so..
Change-Id: If33fc6a90daf7a2c5ceff750953b8cf99c438cf1
Signed-off-by: Jozef Behran <jbehran@cisco.com>
*** Variables ***
${datadir} ${CURDIR}/../../../variables/netconf/MDSAL
${dataext} msg
+${ssh_netconf_pid} -1
*** Test Cases ***
Connect_To_ODL_Netconf
Close_ODL_Netconf_Connection
[Documentation] Correctly close the Netconf connection and make sure it is really dead.
+ BuiltIn.Return_From_Keyword_If ${ssh_netconf_pid} == -1
+ ${kill_command}= BuiltIn.Set_Variable kill ${ssh_netconf_pid}
+ BuiltIn.Set_Suite_Variable ${ssh_netconf_pid} -1
SSHLibrary.Switch_Connection ${ssh_control}
- SSHLibrary.Write kill ${ssh_netconf_pid}
+ SSHLibrary.Write ${kill_command}
SSHLibrary.Read_Until_Prompt
SSHLibrary.Switch_Connection ${ssh_netconf}
SSHLibrary.Read_Until_Prompt