From 77e7a0320ca1e0899604c474f74af97f02077c56 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mon, 6 Jan 2020 15:33:20 +0100 Subject: [PATCH] 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" --- .../no-plugin-exception-during-analyses/runtest.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/Regression/no-plugin-exception-during-analyses/runtest.sh b/tests/Regression/no-plugin-exception-during-analyses/runtest.sh index 6a68cf7..d1cc105 100755 --- a/tests/Regression/no-plugin-exception-during-analyses/runtest.sh +++ b/tests/Regression/no-plugin-exception-during-analyses/runtest.sh @@ -34,21 +34,23 @@ PACKAGE="setroubleshoot" rlJournalStart rlPhaseStartSetup - rlAssertRpm ${PACKAGE} + rlAssertRpm ${PACKAGE}-server rlAssertRpm ${PACKAGE}-plugins rlPhaseEnd rlPhaseStartTest "no 'Plugin Exception'" - SINCE=$(date '+%Y-%m-%d %H:%M:%S') RANDOM_NUMBER=${RANDOM} rlRun "passwd --help >& /root/output-${RANDOM_NUMBER}.txt" rlRun "rm -f /root/output-${RANDOM_NUMBER}.txt" sleep 10 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 - rlRun "[[ $? -eq 0 ]] || cat journal-after.txt" + [[ $? -eq 0 ]] || STATUS=$? + rlRun "[[ $STATUS -eq 0 ]] || cat journal-after.txt" rlPhaseEnd rlPhaseStartCleanup