Skip to content

Commit 88adae1

Browse files
committed
hijack.sh: fail if the logger trace is empty
Does not completely fixes #297 but goes a long way. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent a2669ff commit 88adae1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

case-lib/hijack.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ function func_exit_handler()
4848
# shellcheck disable=SC2154
4949
wcLog=$(wc -l "$logfile")
5050
dlogi "nlines=$wcLog"
51+
local nlines; nlines=$(cat "$logfile" | wc -l)
52+
# Line 1 is the header
53+
if [ "$nlines" -le 1 ]; then
54+
dloge "Empty logger trace"
55+
exit_status=1
56+
fi
5157
fi
5258
# when case ends, store kernel log
5359
# /var/log/kern.log format:

0 commit comments

Comments
 (0)