mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-27 03:40:23 +00:00
58 lines
1.6 KiB
Plaintext
58 lines
1.6 KiB
Plaintext
|
#!/bin/bash
|
||
|
#
|
||
|
# Run a scheduler for TIMEOUT seconds inside virtme-ng and catch potential
|
||
|
# errors, then unload the scheduler and return the exit status.
|
||
|
|
||
|
# Maximum time for each scheduler run.
|
||
|
TEST_TIMEOUT=30
|
||
|
|
||
|
# Maximum timeout for the guest used for each scheduler run (this is used to
|
||
|
# hard-shutdown the guest in case of system hangs).
|
||
|
GUEST_TIMEOUT=60
|
||
|
|
||
|
# List of schedulers to test
|
||
|
#
|
||
|
# TODO:
|
||
|
# - scx_layered: temporarily excluded because it
|
||
|
# cannot run with a default configuration
|
||
|
#
|
||
|
SCHEDULERS="scx_simple scx_central scx_flatcg scx_nest scx_pair scx_qmap scx_userland scx_rusty scx_rustland"
|
||
|
|
||
|
if [ ! -x `which vng` ]; then
|
||
|
echo "vng not found, please install virtme-ng to enable testing"
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ $# -lt 1 ]; then
|
||
|
echo "Usage: $0 VMLINUZ"
|
||
|
exit 1
|
||
|
fi
|
||
|
kernel=$1
|
||
|
|
||
|
for sched in ${SCHEDULERS}; do
|
||
|
sched_path=$(find -type f -executable -name ${sched})
|
||
|
if [ ! -n "${sched_path}" ]; then
|
||
|
echo "${sched}: binary not found"
|
||
|
echo "FAIL: ${sched}"
|
||
|
exit 1
|
||
|
fi
|
||
|
echo "testing ${sched_path}"
|
||
|
|
||
|
rm -f /tmp/output
|
||
|
timeout --preserve-status ${GUEST_TIMEOUT} \
|
||
|
vng --force-9p --disable-microvm -v -r ${kernel} -- \
|
||
|
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${sched_path}" \
|
||
|
2>&1 </dev/null | tee /tmp/output
|
||
|
sed -n -e '/\bBUG:/q1' \
|
||
|
-e '/\bWARNING:/q1' \
|
||
|
-e '/\berror\b/Iq1' \
|
||
|
-e '/\bstall/Iq1' \
|
||
|
-e '/\btimeout\b/Iq1' /tmp/output
|
||
|
res=$?
|
||
|
if [ ${res} -ne 0 ]; then
|
||
|
echo "FAIL: ${sched}"
|
||
|
exit 1
|
||
|
else
|
||
|
echo "OK: ${sched}"
|
||
|
fi
|
||
|
done
|