-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-vmtest: sched_ext selftests support #149
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
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 | ||
|
||
failed=$(tail -n 16 runner.log | grep "FAILED" | awk '{print $2}') | ||
|
||
echo "selftests/sched_ext:$failed" >>"${STATUS_FILE}" | ||
|
||
foldable end selftests/sched_ext |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,28 @@ | |
set -euo pipefail | ||
trap 'exit 2' ERR | ||
|
||
source $(cd $(dirname $0) && pwd)/../helpers.sh | ||
source "${GITHUB_ACTION_PATH}/../helpers.sh" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the change from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been trying to use common env vars for paths everywhere, and However, in this case I don't think important, so I don't mind leaving pwd. Any particular reasons in favor of |
||
|
||
RUN_BPFTOOL_CHECKS= | ||
|
||
if [[ "$KERNEL_TEST" != "sched_ext" ]]; then | ||
VMTEST_SCRIPT="${GITHUB_ACTION_PATH}/../ci/vmtest/vmtest_selftests.sh" | ||
if [[ "${KERNEL}" = 'LATEST' ]]; then | ||
RUN_BPFTOOL_CHECKS=true | ||
fi | ||
else | ||
VMTEST_SCRIPT="${GITHUB_ACTION_PATH}/../ci/vmtest/sched_ext_selftests.sh" | ||
fi | ||
|
||
chantra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# clear exitstatus file | ||
echo -n "" > exitstatus | ||
|
||
foldable start bpftool_checks "Running bpftool checks..." | ||
bpftool_exitstatus=0 | ||
|
||
# bpftool checks are aimed at checking type names, documentation, shell | ||
# completion etc. against the current kernel, so only run on LATEST. | ||
if [[ "${KERNEL}" = 'LATEST' ]]; then | ||
if [[ -n "${RUN_BPFTOOL_CHECKS}" ]]; then | ||
bpftool_exitstatus=0 | ||
# "&& true" does not change the return code (it is not executed if the | ||
# Python script fails), but it prevents the trap on ERR set at the top | ||
# of this file to trigger on failure. | ||
|
@@ -21,30 +35,28 @@ if [[ "${KERNEL}" = 'LATEST' ]]; then | |
else | ||
echo "bpftool checks returned ${bpftool_exitstatus}." | ||
fi | ||
echo "bpftool:${bpftool_exitstatus}" >> exitstatus | ||
else | ||
echo "bpftool checks skipped." | ||
fi | ||
|
||
bpftool_exitstatus="bpftool:${bpftool_exitstatus}" | ||
foldable end bpftool_checks | ||
|
||
foldable start vmtest "Starting virtual machine..." | ||
|
||
# Tests may be comma-separated. vmtest_selftest expect them to come from CLI space-separated. | ||
T=$(echo ${KERNEL_TEST} | tr -s ',' ' ') | ||
# HACK: We need to unmount /tmp to access /tmp from the container.... | ||
vmtest -k "${VMLINUZ}" --kargs "panic=-1 sysctl.vm.panic_on_oom=1" "umount /tmp && \ | ||
Comment on lines
-35
to
-36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was surprised to see this.... but we essentially do not need to umount /tmp since danobi/vmtest@0a63dce There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. I actually had to remove it, otherwise it failed to umount. |
||
/bin/mount bpffs /sys/fs/bpf -t bpf && \ | ||
ip link set lo up && \ | ||
cd '${GITHUB_WORKSPACE}' && \ | ||
./ci/vmtest/vmtest_selftests.sh ${T}" | ||
vmtest -k "${VMLINUZ}" --kargs "panic=-1 sysctl.vm.panic_on_oom=1" \ | ||
"/bin/mount bpffs /sys/fs/bpf -t bpf && \ | ||
ip link set lo up && \ | ||
cd '${GITHUB_WORKSPACE}' && \ | ||
${VMTEST_SCRIPT} ${T}" | ||
|
||
foldable end vmtest | ||
|
||
foldable start collect_status "Collecting exit status" | ||
|
||
exitfile="${bpftool_exitstatus}\n" | ||
exitfile+="$(cat exitstatus 2>/dev/null)" | ||
exitfile="$(cat exitstatus 2>/dev/null)" | ||
exitstatus="$(echo -e "$exitfile" | awk --field-separator ':' \ | ||
'BEGIN { s=0 } { if ($2) {s=1} } END { print s }')" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!