HDDS-1677. Auditparser robot test shold use a world writable working directory (#958)

This commit is contained in:
Elek, Márton 2019-06-14 01:04:14 +02:00 committed by Bharat Viswanadham
parent bcfd228336
commit 89acbbc0b9
1 changed files with 8 additions and 7 deletions

View File

@ -22,6 +22,7 @@ Resource ../commonlib.robot
*** Variables *** *** Variables ***
${user} hadoop ${user} hadoop
${count} 4 ${count} 4
${auditworkdir} /tmp/
*** Keywords *** *** Keywords ***
Set username Set username
@ -38,15 +39,15 @@ Initiating freon to generate data
Testing audit parser Testing audit parser
${logdir} = Get Environment Variable HADOOP_LOG_DIR /var/log/hadoop ${logdir} = Get Environment Variable HADOOP_LOG_DIR /var/log/hadoop
${logfile} = Execute ls -t "${logdir}" | grep om-audit | head -1 ${logfile} = Execute ls -t "${logdir}" | grep om-audit | head -1
Execute ozone auditparser /opt/hadoop/audit.db load "${logdir}/${logfile}" Execute ozone auditparser "${auditworkdir}/audit.db" load "${logdir}/${logfile}"
${result} = Execute ozone auditparser /opt/hadoop/audit.db template top5cmds ${result} = Execute ozone auditparser "${auditworkdir}/audit.db" template top5cmds
Should Contain ${result} ALLOCATE_KEY Should Contain ${result} ALLOCATE_KEY
${result} = Execute ozone auditparser /opt/hadoop/audit.db template top5users ${result} = Execute ozone auditparser "${auditworkdir}/audit.db" template top5users
Run Keyword If '${SECURITY_ENABLED}' == 'true' Set username Run Keyword If '${SECURITY_ENABLED}' == 'true' Set username
Should Contain ${result} ${user} Should Contain ${result} ${user}
${result} = Execute ozone auditparser /opt/hadoop/audit.db query "select count(*) from audit where op='CREATE_VOLUME' and RESULT='SUCCESS'" ${result} = Execute ozone auditparser "${auditworkdir}/audit.db" query "select count(*) from audit where op='CREATE_VOLUME' and RESULT='SUCCESS'"
${result} = Convert To Number ${result} ${result} = Convert To Number ${result}
Should be true ${result}>${count} Should be true ${result}>${count}
${result} = Execute ozone auditparser /opt/hadoop/audit.db query "select count(*) from audit where op='CREATE_BUCKET' and RESULT='SUCCESS'" ${result} = Execute ozone auditparser "${auditworkdir}/audit.db" query "select count(*) from audit where op='CREATE_BUCKET' and RESULT='SUCCESS'"
${result} = Convert To Number ${result} ${result} = Convert To Number ${result}
Should be true ${result}>${count} Should be true ${result}>${count}