2020-04-07 18:22:26 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BASEDIR=$(dirname "$0")
|
|
|
|
|
2020-05-07 23:56:32 +03:00
|
|
|
echo ""
|
|
|
|
|
2020-04-07 18:22:26 +03:00
|
|
|
# Filter all log files for errors, substitute variable data and match against whitelist.
|
2020-12-04 13:19:14 +03:00
|
|
|
find $BASEDIR -name "*.log" | xargs grep -h "\[ERR\]" | \
|
2020-04-07 18:22:26 +03:00
|
|
|
sed -r -f $BASEDIR/log_substitutions.txt | \
|
|
|
|
sort | uniq | \
|
2020-05-04 23:20:00 +03:00
|
|
|
grep -Fvi -f $BASEDIR/log_error_whitelist.txt
|
2020-04-07 18:22:26 +03:00
|
|
|
|
|
|
|
# If something shows up (not on whitelist) exit with error code 1.
|
2020-05-07 23:56:32 +03:00
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
echo ""
|
|
|
|
echo "In the itest logs, the log line (patterns) above were detected."
|
|
|
|
echo "[ERR] lines are generally reserved for internal errors."
|
|
|
|
echo "Resolve the issue by either changing the log level or adding an "
|
|
|
|
echo "exception to log_error_whitelist.txt"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "No itest errors detected."
|
|
|
|
echo ""
|