Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
scx: Refactor binary run logic in scx CI
Browse files Browse the repository at this point in the history
We're currently invoking vng only when iterating over the schedulers in
tools/sched_ext. We should also be running our selftests in CI, so let's
refactor that logic to a new, separate runtest() bash function. Along
the way, remove some extra, unnecessary scx_layered-specific logic. We
no longer ship scx_layered in the sched_ext repo, so we can remove it.

Signed-off-by: David Vernet <[email protected]>
  • Loading branch information
Byte-Lab committed Apr 30, 2024
1 parent 1524224 commit 92505bf
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/run-schedulers
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ if [ ! -x `which vng` ]; then
exit 1
fi

function runtest() {
local bin="${1}"

if [ -z "${bin}" ]; then
echo "No binary passed to runtest"
exit 1
fi

if ! [ -f "${bin}" ]; then
echo "Binary ${bin} was not a regular file"
exit 1
fi

rm -f /tmp/output
(timeout --foreground --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p --disable-microvm --verbose -- \
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${bin}" \
2>&1 </dev/null || true) | tee /tmp/output
}

# Test all the available schedulers.
#
# NOTE: virtme-ng automatically runs the kernel from the current working
Expand All @@ -24,18 +44,8 @@ fi
# Each scheduler will be tested in a separate instance booted from scratch, to
# ensure that each run does not impact the others.
#
# TODO: exclude scx_layered for now, because it requires a special config
# file, otherwise its test would fail with "Error: No layer spec".
#
# Maybe in the future change scx_layered to run with a default layer spec, just
# for testing it.
#
for sched in $(find tools/sched_ext/build/bin -type f -executable | grep -v scx_layered); do
rm -f /tmp/output
(timeout --foreground --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p --disable-microvm --verbose -- \
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${sched}" \
2>&1 </dev/null || true) | tee /tmp/output
for sched in $(find tools/sched_ext/build/bin -type f -executable); do
runtest "${sched}"
sed -n -e '/\bBUG:/q1' \
-e '/\bWARNING:/q1' \
-e '/\berror\b/Iq1' \
Expand Down

0 comments on commit 92505bf

Please sign in to comment.