tests: Few no-plugin-exception-during-analyses improvements
- when first grep fails print journal as well - check for setroubleshoot-server instead of setroubleshoot - improve grep assert to match "passwd" and "/usr/bin/passwd"
This commit is contained in:
parent
0340721f20
commit
77e7a0320c
@ -34,21 +34,23 @@ PACKAGE="setroubleshoot"
|
|||||||
|
|
||||||
rlJournalStart
|
rlJournalStart
|
||||||
rlPhaseStartSetup
|
rlPhaseStartSetup
|
||||||
rlAssertRpm ${PACKAGE}
|
rlAssertRpm ${PACKAGE}-server
|
||||||
rlAssertRpm ${PACKAGE}-plugins
|
rlAssertRpm ${PACKAGE}-plugins
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartTest "no 'Plugin Exception'"
|
rlPhaseStartTest "no 'Plugin Exception'"
|
||||||
|
|
||||||
SINCE=$(date '+%Y-%m-%d %H:%M:%S')
|
SINCE=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
RANDOM_NUMBER=${RANDOM}
|
RANDOM_NUMBER=${RANDOM}
|
||||||
rlRun "passwd --help >& /root/output-${RANDOM_NUMBER}.txt"
|
rlRun "passwd --help >& /root/output-${RANDOM_NUMBER}.txt"
|
||||||
rlRun "rm -f /root/output-${RANDOM_NUMBER}.txt"
|
rlRun "rm -f /root/output-${RANDOM_NUMBER}.txt"
|
||||||
sleep 10
|
sleep 10
|
||||||
rlRun "journalctl --since=\"$SINCE\" > journal-after.txt"
|
rlRun "journalctl --since=\"$SINCE\" > journal-after.txt"
|
||||||
rlAssertGrep "setroubleshoot.*: SELinux is preventing passwd" journal-after.txt
|
STATUS=0
|
||||||
|
rlAssertGrep "setroubleshoot.*: SELinux is preventing (/usr/bin/)?passwd" journal-after.txt -E
|
||||||
|
[[ $? -eq 0 ]] || STATUS=$?
|
||||||
rlAssertNotGrep "setroubleshoot.*: Plugin Exception " journal-after.txt
|
rlAssertNotGrep "setroubleshoot.*: Plugin Exception " journal-after.txt
|
||||||
rlRun "[[ $? -eq 0 ]] || cat journal-after.txt"
|
[[ $? -eq 0 ]] || STATUS=$?
|
||||||
|
rlRun "[[ $STATUS -eq 0 ]] || cat journal-after.txt"
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
rlPhaseStartCleanup
|
||||||
|
Loading…
Reference in New Issue
Block a user