diff --git a/.ci/run.sh b/.ci/run.sh index 2fabd2e511..8de3ecaaf5 100755 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -9,6 +9,37 @@ set -e +check_log_files() +{ + make log-parser + + for component in \ + kata-proxy \ + kata-shim \ + "${RUNTIME}" + do + file="${component}.log" + args="--no-pager -q -o cat -a -t \"${component}\"" + + cmd="sudo journalctl ${args} > ${file}" + eval "$cmd" + done + + logs=$(ls "$(pwd)"/*.log) + { kata-log-parser --check-only $logs; ret=$?; } || true + + # Always remove logs since: + # + # - We don't want to waste disk-space. + # - The teardown script will save the full logs anyway. + # - the log parser tool shows full details of what went wrong. + rm -f $logs + + [ $ret -ne 0 ] && false +} + export RUNTIME="kata-runtime" sudo -E PATH="$PATH" bash -c "make check" + +check_log_files