Support password-based ssh auth
[validation.git] / tests / os / lynis / lynis.robot
index 7d88c0f..a51af7f 100644 (file)
@@ -40,11 +40,14 @@ Run Lynis Audit System
     Append To File  ${log}  ${stdout}${\n}
     Should Be Equal As Integers  ${rc} 0
 
+    ${status} =  Evaluate  "Great, no warnings" in """${stdout}"""
+    Run Keyword If  '${status}' == 'False'  FAIL  Warnings discovered
+    ...                     non-critical
 
 *** Keywords ***
 Open Connection And Log In
     Open Connection  ${HOST}
-    Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}
+    Run Keyword IF  '${SSH_KEYFILE}' != 'None'  Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}  ELSE IF  '${PASSWORD}' != 'None'  Login  ${USERNAME}  ${PASSWORD}  ELSE  FAIL
 
 Install Lynis
     [Documentation]  Install Lynis