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
Set Environment Variable GOROOT /root/go
- Set Environment Variable GOPATH /root/go/src
- Set Environment Variable PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin:/root/go/src/bin
+ Set Environment Variable GOPATH /root/go/src/github.com
+ Set Environment Variable PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin:/root/go/src/github.com/bin
Set Environment Variable LC_ALL en_US.UTF-8
Set Environment Variable LANG en_US.UTF-8
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
${rc} = Run And Return Rc ssh '${USERNAME}'@'${HOST}' "sed -i 's#${idssh}##' ~/.ssh/authorized_keys"
Should Be Equal As Integers ${rc} 0
+# Loglevel can be TRACE, DEBUG, INFO, WARN and NONE (no logging). Default is INFO
Open Connection And Log In
+ Set Default Configuration loglevel=INFO
Open Connection ${HOST}
Run Keyword IF '${SSH_KEYFILE}' != 'None' Login With Public Key ${USERNAME} ${SSH_KEYFILE} ELSE IF '${PASSWORD}' != 'None' Login ${USERNAME} ${PASSWORD} ELSE FAIL