Skip to content

Commit

Permalink
run-vmtest: dump dmesg on sched_ext tests failure
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Solodrai <isolodrai@meta.com>
  • Loading branch information
theihor committed Dec 20, 2024
1 parent 0c19141 commit beb848b
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions run-vmtest/run-scx-selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,35 @@

set -euo pipefail

source "$(cd "$(dirname "$0")" && pwd)/helpers.sh"

foldable start selftests/sched_ext "Executing selftests/sched_ext/runner"

SELFTESTS_DIR="${KERNEL_ROOT}/selftests/sched_ext"
STATUS_FILE=/mnt/vmtest/exitstatus

cd "${SELFTESTS_DIR}"
./runner "$@" | tee runner.log

echo "Executing selftests/sched_ext/runner"
echo "runner output is being written to runner.log"

./runner "$@" 2>&1 > runner.log & wait

echo "runner finished, check results"
echo "[...]"
tail -n 16 runner.log

failed=$(tail -n 16 runner.log | grep "FAILED" | awk '{print $2}')

echo "selftests/sched_ext:$failed" >>"${STATUS_FILE}"
if [ "$failed" -gt 0 ]; then
echo "Tests failed, dumping full runners log and dmesg"

echo "-------- runner.log start --------"
cat runner.log
echo "-------- runner.log end ----------"

echo "-------- dmesg start --------"
dmesg -H
echo "-------- dmesg end ----------"
fi

echo "selftests/sched_ext:$failed" >> "${STATUS_FILE}"

exit 0

foldable end selftests/sched_ext

0 comments on commit beb848b

Please sign in to comment.