Skip to content

Commit

Permalink
ci/vmtest: sync scripts with libbpf/ci#149
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Solodrai <[email protected]>
  • Loading branch information
theihor committed Nov 7, 2024
1 parent b21e6a7 commit 5797ab2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# zstd is installed by default in the runner images.
run: zstd -d -T0 vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst --stdout | tar -xf -
- name: Run selftests
uses: libbpf/ci/run-vmtest@v1
uses: theihor/libbpf-ci/run-vmtest@run-scx
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
# booleans are weird in GH.
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kernel-veristat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}

- name: Run veristat
uses: libbpf/ci/run-vmtest@v1
uses: theihor/libbpf-ci/run-vmtest@run-scx
with:
arch: x86_64
img: '/tmp/root.img'
Expand Down
8 changes: 8 additions & 0 deletions ci/vmtest/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ print_error() {
print_notice() {
__print notice $1 $2
}

read_lists() {
(for path in "$@"; do
if [[ -s "$path" ]]; then
cat "$path"
fi;
done) | cut -d'#' -f1 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | tr -s '\n' ','
}
19 changes: 19 additions & 0 deletions ci/vmtest/sched_ext_selftests.sh
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
8 changes: 0 additions & 8 deletions ci/vmtest/vmtest_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ WORKING_DIR="/${PROJECT_NAME}"
BPF_SELFTESTS_DIR="${WORKING_DIR}/selftests/bpf"
VMTEST_CONFIGS_PATH="${WORKING_DIR}/ci/vmtest/configs"

read_lists() {
(for path in "$@"; do
if [[ -s "$path" ]]; then
cat "$path"
fi;
done) | cut -d'#' -f1 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | tr -s '\n' ','
}

DENYLIST=$(read_lists \
"$BPF_SELFTESTS_DIR/DENYLIST" \
"$BPF_SELFTESTS_DIR/DENYLIST.${ARCH}" \
Expand Down

0 comments on commit 5797ab2

Please sign in to comment.