-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkernel_kselftest.sh
More file actions
executable file
·77 lines (64 loc) · 1.57 KB
/
kernel_kselftest.sh
File metadata and controls
executable file
·77 lines (64 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
set -e
KSELFTEST_LOG_DIR=${KSELFTEST_LOG_DIR:-../kselftest-logs}
# So we can detect what version of Rocky we are running on
. /etc/os-release
if [ ! -f .config ] ; then
echo "No .config found. Please configure before testing"
exit 1
fi
if [ $# -eq 1 ] ; then
runs=$1
else
runs=1
fi
run_kselftest() {
mkdir -p "$KSELFTEST_LOG_DIR"
pushd tools/bpf/bpftool
make -j$(nproc)
popd
make -j$(nproc) samples/bpf/
BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
KSELFTEST_PATH=/var/kselftests
pushd tools/testing/selftests
make -j$(nproc) SKIP_TARGETS="$SKIP_TARGETS" INSTALL_PATH="$KSELFTEST_PATH" install
popd
for run in $(seq 1 $runs) ; do
"$KSELFTEST_PATH/run_kselftest.sh" | tee "$KSELFTEST_LOG_DIR/selftest-$(uname -r)-$run.log"
done
}
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"$SCRIPT_DIR/kernel_install_dep.sh"
case $(uname -r) in
*3.10.0*)
echo
echo "Running 3.10.0 kselftests"
echo
SKIP_TARGETS=""
;;
*4.18.0*)
echo
echo "Running 4.18.0 kselftests"
echo
SKIP_TARGETS=""
;;
*5.14.0*)
echo
echo "Running 5.14.0 kselftests"
echo
SKIP_TARGETS="lkdtm proc pidfd"
;;
*6.12.*|\
*6.18.*)
echo
echo "Running 6.12/6.18 kselftests"
echo
SKIP_TARGETS="lkdtm net/forwarding"
;;
*)
echo
echo "Warning: Unknown kernel version ($(uname -r)). No kselftest targets defined."
exit 1
;;
esac
run_kselftest