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
Run Keyword IF '${SSH_KEYFILE}' == 'None' Create ssh_keyfile
- ${rc} = Run And Return Rc vuls scan -config ${CURDIR}/config.toml -ssh-config
+ ${rc} = Run And Return Rc vuls scan -config ${CURDIR}/config.toml
Should Be Equal As Integers ${rc} 0
Run Keyword IF '${os}' == 'ubuntu' Run vuls for ubuntu ELSE IF '${os}' == 'centos' Run vuls for centos ELSE FAIL Distro '${os}' not supported
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
Set Global Variable ${LOG} ${output}
Run vuls for centos
- ${rc} ${output} = Run And Return Rc And Output vuls report -config ${CURDIR}/config.toml -cvedb-sqlite3-path=${CURDIR}/cve.sqlite3 -ovaldb-sqlite3-path=${CURDIR}/oval_centos.sqlite3 -gostdb-sqlite3-path=${CURDIR}/gost_centos.sqlite3
+ ${os_version} = SSHLibrary.Execute Command source /etc/os-release && echo $VERSION_ID | cut -d '.' -f1
+
+ ${rc} ${output} = Run And Return Rc And Output vuls report -config ${CURDIR}/config.toml -cvedb-sqlite3-path=${CURDIR}/cve.sqlite3 -ovaldb-sqlite3-path=${CURDIR}/oval_centos_${os_version}.sqlite3 -gostdb-sqlite3-path=${CURDIR}/gost_centos.sqlite3
Should Be Equal As Integers ${rc} 0
Append To File ${LOG_PATH}/vuls.log ${output}${\n}
Set Global Variable ${LOG} ${output}