1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-04-26 22:02:31 +02:00

ci: cleanup build.sh test log output

Unlike the original ima-evm-utils ima_hash.test and sign_verify.test
selftests, kernel tests may fail for any number of reasons (e.g. kernel
config, permissions, missing applications, test infrastructure).  For
these tests, the full test log is needed to analyze the failure.

Create a phony target in tests/Makefile.am named "check-logs". Based on
test name, output different amounts of the test log.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Mimi Zohar 2023-01-24 12:44:26 -05:00
parent 58b4c7ac4b
commit d18d6fff5c
2 changed files with 14 additions and 22 deletions

View File

@ -97,28 +97,7 @@ VERBOSE=1 make check || ret=$?
title "logs"
if [ $ret -eq 0 ]; then
if [ -f tests/ima_hash.log ]; then
tail -3 tests/ima_hash.log
grep "skipped" tests/ima_hash.log && \
grep "skipped" tests/ima_hash.log | wc -l
fi
if [ -f tests/sign_verify.log ]; then
tail -3 tests/sign_verify.log
grep "skipped" tests/sign_verify.log && \
grep "skipped" tests/sign_verify.log | wc -l
fi
tail -20 tests/boot_aggregate.log
if [ -f tests/fsverity.log ]; then
[ -n "$CI" ] && cat tests/fsverity.log || tail tests/fsverity.log
grep "skipped" tests/fsverity.log && \
grep "skipped" tests/fsverity.log | wc -l
fi
if [ -f tests/portable_signatures.log ]; then
[ -n "$CI" ] && cat tests/portable_signatures.log || tail tests/portable_signatures.log
grep "skipped" tests/portable_signatures.log && \
grep "skipped" tests/portable_signatures.log | wc -l
fi
cd tests; make check_logs; cd ..
exit 0
fi

View File

@ -4,6 +4,19 @@ TESTS = $(check_SCRIPTS)
check_SCRIPTS += ima_hash.test sign_verify.test boot_aggregate.test \
fsverity.test portable_signatures.test
.PHONY: check_logs
check_logs:
@for log in $(TEST_LOGS); do \
echo -e "\n***" $$log "***" ; \
case $$log in \
ima_hash.log | sign_verify.log ) \
tail -3 $$log ; \
grep "skipped" $$log && grep "skipped" $$log | wc -l ;; \
*) \
cat $$log ;; \
esac ; \
done
clean-local:
-rm -f *.txt *.out *.sig *.sig2