Skip to content

Commit 5940c5b

Browse files
Jakub KicinskiAlexei Starovoitov
Jakub Kicinski
authored and
Alexei Starovoitov
committed
selftests, bpftool: Skip the build test if not in tree
If selftests are copied over to another machine/location for execution the build test of bpftool will obviously not work, since the sources are not copied. Skip it if we can't find bpftool's Makefile. Reported-by: Naresh Kamboju <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Quentin Monnet <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 31f8b82 commit 5940c5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/bpf/test_bpftool_build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ SCRIPT_REL_PATH=$(realpath --relative-to=$PWD $0)
2020
SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH)
2121
KDIR_ROOT_DIR=$(realpath $PWD/$SCRIPT_REL_DIR/../../../../)
2222
cd $KDIR_ROOT_DIR
23+
if [ ! -e tools/bpf/bpftool/Makefile ]; then
24+
echo -e "skip: bpftool files not found!\n"
25+
exit 0
26+
fi
2327

2428
ERROR=0
2529
TMPDIR=

0 commit comments

Comments
 (0)