Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / tools / testing / selftests / bpf / test_libbpf.sh
blobd97dc914cd49690ab4c9953544a73117dcae6c05
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 export TESTNAME=test_libbpf
6 # Determine selftest success via shell exit code
7 exit_handler()
9 if (( $? == 0 )); then
10 echo "selftests: $TESTNAME [PASS]";
11 else
12 echo "$TESTNAME: failed at file $LAST_LOADED" 1>&2
13 echo "selftests: $TESTNAME [FAILED]";
17 libbpf_open_file()
19 LAST_LOADED=$1
20 if [ -n "$VERBOSE" ]; then
21 ./test_libbpf_open $1
22 else
23 ./test_libbpf_open --quiet $1
27 # Exit script immediately (well catched by trap handler) if any
28 # program/thing exits with a non-zero status.
29 set -e
31 # (Use 'trap -l' to list meaning of numbers)
32 trap exit_handler 0 2 3 6 9
34 libbpf_open_file test_l4lb.o
36 # TODO: fix libbpf to load noinline functions
37 # [warning] libbpf: incorrect bpf_call opcode
38 #libbpf_open_file test_l4lb_noinline.o
40 # TODO: fix test_xdp_meta.c to load with libbpf
41 # [warning] libbpf: test_xdp_meta.o doesn't provide kernel version
42 #libbpf_open_file test_xdp_meta.o
44 # TODO: fix libbpf to handle .eh_frame
45 # [warning] libbpf: relocation failed: no section(10)
46 #libbpf_open_file ../../../../samples/bpf/tracex3_kern.o
48 # Success
49 exit 0