diff options
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest | 61 | ||||
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb | 3 |
2 files changed, 30 insertions, 34 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest index 93d2db2..72dc0ab 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest | |||
@@ -1,53 +1,50 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/sh |
2 | 2 | ||
3 | # The whole test suite may take up to 40 minutes to run, so setting -t 2400 | 3 | # The whole test suite may take up to 40 minutes to run, so setting -t 2400 |
4 | # parameter in ptest-runner is necessary to not kill it before completion | 4 | # parameter in ptest-runner is necessary to not kill it before completion |
5 | 5 | ||
6 | cd tests | 6 | cd tests || exit 1 |
7 | export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin | 7 | export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin |
8 | 8 | ||
9 | PASS_CNT=0 | 9 | PASS_CNT=0 |
10 | FAIL_CNT=0 | 10 | FAIL_CNT=0 |
11 | SKIP_CNT=0 | 11 | SKIP_CNT=0 |
12 | FAILED=() | 12 | FAILED="" |
13 | 13 | ||
14 | print_test_result() { | ||
15 | if [ $? -eq 0 ]; then | ||
16 | echo "PASS: $1" | ||
17 | PASS_CNT=$((PASS_CNT + 1)) | ||
18 | else | ||
19 | echo "FAIL: $1" | ||
20 | FAIL_CNT=$((FAIL_CNT + 1)) | ||
21 | FAILED="${FAILED:+$FAILED }$1;" | ||
22 | fi | ||
23 | } | ||
24 | |||
25 | IFS=$(printf '\n\t') | ||
14 | # Start unit tests | 26 | # Start unit tests |
15 | for test_case in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do | 27 | for test_name in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do |
16 | if ./bpftrace_test --gtest_filter="${test_case}*" > /dev/null 2>&1 ; then | 28 | ./bpftrace_test --gtest_filter="${test_name}*" > /dev/null 2>&1 |
17 | echo PASS: Unit test $test_case | 29 | print_test_result "unit:$test_name" |
18 | PASS_CNT=$(($PASS_CNT + 1)) | ||
19 | else | ||
20 | echo FAIL: Unit test $test_case | ||
21 | FAIL_CNT=$(($FAIL_CNT + 1)) | ||
22 | FAILED+=("unit:${test_case}") | ||
23 | fi | ||
24 | done | 30 | done |
25 | 31 | ||
26 | # Start runtime tests | 32 | # Start runtime tests |
27 | for test_case in $(ls runtime); do | 33 | for test_name in $(ls runtime); do |
28 | # Ignore test cases that hang the suite forever (bpftrace v0.16.0) | 34 | # Ignore test cases that hang the suite forever (bpftrace v0.14.1) |
29 | case $test_case in | 35 | if [ "$test_name" = "sigint" ] || [ "$test_name" = "watchpoint" ]; then |
30 | sigint) | 36 | echo "SKIP: runtime:$test_name" |
31 | ;& | 37 | SKIP_CNT=$((SKIP_CNT + 1)) |
32 | watchpoint) | 38 | continue |
33 | echo SKIP: Runtime test $test_case | ||
34 | SKIP_CNT=$(($SKIP_CNT + 1)) | ||
35 | continue | ||
36 | ;; | ||
37 | esac | ||
38 | if ./runtime-tests.sh --filter="${test_case}.*" > /dev/null 2>&1 ; then | ||
39 | echo PASS: Runtime test $test_case | ||
40 | PASS_CNT=$(($PASS_CNT + 1)) | ||
41 | else | ||
42 | echo FAIL: Runtime test $test_case | ||
43 | FAIL_CNT=$(($FAIL_CNT + 1)) | ||
44 | FAILED+=("runtime:${test_case}") | ||
45 | fi | 39 | fi |
40 | python3 runtime/engine/main.py --filter="${test_name}.*" > /dev/null 2>&1 | ||
41 | print_test_result "runtime:$test_name" | ||
46 | done | 42 | done |
43 | unset IFS | ||
47 | 44 | ||
48 | echo "#### bpftrace tests summary ####" | 45 | echo "#### bpftrace tests summary ####" |
49 | echo "# TOTAL: $(($PASS_CNT + $FAIL_CNT + $SKIP_CNT))" | 46 | echo "# TOTAL: $((PASS_CNT + FAIL_CNT + SKIP_CNT))" |
50 | echo "# PASS: $PASS_CNT" | 47 | echo "# PASS: $PASS_CNT" |
51 | echo "# FAIL: $FAIL_CNT (${FAILED[*]})" | 48 | echo "# FAIL: $FAIL_CNT ($FAILED)" |
52 | echo "# SKIP: $SKIP_CNT" | 49 | echo "# SKIP: $SKIP_CNT" |
53 | echo "################################" | 50 | echo "################################" |
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb index 4a03ab0..c6cfdab 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb | |||
@@ -15,7 +15,6 @@ DEPENDS += "bison-native \ | |||
15 | 15 | ||
16 | PV .= "+git${SRCREV}" | 16 | PV .= "+git${SRCREV}" |
17 | RDEPENDS:${PN} += "bash python3 xz" | 17 | RDEPENDS:${PN} += "bash python3 xz" |
18 | RDEPENDS:${PN}-ptest += "bash" | ||
19 | 18 | ||
20 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ | 19 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ |
21 | file://0001-Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_.patch \ | 20 | file://0001-Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_.patch \ |
@@ -39,7 +38,7 @@ PACKAGECONFIG[tests] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF,gtest xxd-native" | |||
39 | do_install_ptest() { | 38 | do_install_ptest() { |
40 | if [ -e ${B}/tests/bpftrace_test ]; then | 39 | if [ -e ${B}/tests/bpftrace_test ]; then |
41 | install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test | 40 | install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test |
42 | cp -rf ${B}/tests/runtime* ${D}${PTEST_PATH}/tests | 41 | cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests |
43 | cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests | 42 | cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests |
44 | fi | 43 | fi |
45 | } | 44 | } |