Skip to content

Commit

Permalink
simlogcheck: cat problematic files
Browse files Browse the repository at this point in the history
print problematic file so that we can see the problem in the CI logs
  • Loading branch information
sawenzel committed May 25, 2021
1 parent b7edbe6 commit 9f6c9b8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions run/simlogcheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -l
set -x

# a script checking logfiles for signs of error
# a script checking logfiles for signs of errors
# can be used to detect most common errors automatically
# returns/exits with 0 if no problem

Expand All @@ -10,19 +10,29 @@ error=0
for file in "$@"; do
echo "looking into ${file}"

fileerrors=0

# We don't want to see "Error" or "ERROR" messages
value=$(grep "Error" ${file})
if [ -n "${value}" ]; then
echo "check for Error failed"
let error=error+1
let filererrors=fileerrors+1
fi

value=$(grep "ERROR" ${file})
if [ -n "${value}" ]; then
echo "check for ERROR failed"
let error=error+1
let fileerrors=fileerrors+1
fi

if [ "${fileerrors}" != "0" ]; then
echo "Found problem in file ${file}"
echo "<--- START OF FILE ${file} ---"
cat ${file}
echo "**** END OF FILE ${file} ****>"
fi

let error=fileerrors+error
done

exit ${error}

0 comments on commit 9f6c9b8

Please sign in to comment.