Fix ssh cleanup issue for vuls test 21/3421/1
authorDANIEL STOICA <daniel.stoica@enea.com>
Tue, 12 May 2020 14:00:05 +0000 (17:00 +0300)
committerDANIEL STOICA <daniel.stoica@enea.com>
Tue, 12 May 2020 14:15:07 +0000 (17:15 +0300)
Make ssh cleanup only if the ssh_keyfile was created

Signed-off-by: DANIEL STOICA <daniel.stoica@enea.com>
Change-Id: I685c12bbd0a374a7a6381dfbe5eb53c36c076062

tests/os/vuls/vuls.robot

index 6095ffb..0847322 100644 (file)
@@ -20,9 +20,7 @@ Library           SSHLibrary
 Library           OperatingSystem
 Library           BuiltIn
 Suite Setup       Open Connection And Log In
-Suite Teardown    Run Keywords
-...               Cleanup ssh
-...               Close All Connections
+Suite Teardown    Close All Connections
 
 *** Test Cases ***
 Run Vuls test
@@ -54,6 +52,8 @@ Run Vuls test
     Run Keyword If  '${status}' == 'False'  FAIL  Vulnerabilities discovered
     ...                     non-critical
 
+    Run Keyword IF  '${SSH_KEYFILE}' == 'None'  Cleanup ssh
+
 *** Keywords ***
 Run vuls for ubuntu
     ${os_version} =  SSHLibrary.Execute Command  source /etc/os-release && echo $VERSION_ID | cut -d '.' -f1