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 15, 2024
1 parent 2d65101 commit d5c980a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
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
10 changes: 1 addition & 9 deletions ci/vmtest/vmtest_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -euo pipefail
source "$(cd "$(dirname "$0")" && pwd)/helpers.sh"

ARCH=$(uname -m)
DEPLOYMENT=$(if [[ "$GITHUB_REPOSITORY" == *"-rc" ]]; then echo "rc"; else echo "prod"; fi)
DEPLOYMENT=$(if [[ "$GITHUB_REPOSITORY" == "kernel-patches/bpf" ]]; then echo "prod"; else echo "rc"; fi)

STATUS_FILE=/mnt/vmtest/exitstatus
OUTPUT_DIR=/mnt/vmtest
Expand All @@ -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 d5c980a

Please sign in to comment.