selftests/bpf: Add missing files required by test_bpftool.sh for installing
authorLi Zhijian <lizhijian@cn.fujitsu.com>
Fri, 20 Aug 2021 01:55:56 +0000 (09:55 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Aug 2021 21:01:10 +0000 (14:01 -0700)
test_bpftool.sh relies on bpftool and test_bpftool.py.

'make install' will install bpftool to INSTALL_PATH/bpf/bpftool, and
export it to PATH so that it can be used after installing.

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210820015556.23276-5-lizhijian@cn.fujitsu.com
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_bpftool.sh

index 2a58b7b5aea48bb44bdcf3a15867ceb2dbca7726..866531c08e4f9da1e892b1c7cd15e24552774b81 100644 (file)
@@ -79,7 +79,7 @@ TEST_PROGS := test_kmod.sh \
 
 TEST_PROGS_EXTENDED := with_addr.sh \
        with_tunnels.sh \
-       test_xdp_vlan.sh
+       test_xdp_vlan.sh test_bpftool.py
 
 # Compile but not part of 'make run_tests'
 TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
@@ -187,6 +187,8 @@ $(OUTPUT)/runqslower: $(BPFOBJ) | $(DEFAULT_BPFTOOL)
                    BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR) &&      \
                    cp $(SCRATCH_DIR)/runqslower $@
 
+TEST_GEN_PROGS_EXTENDED += $(DEFAULT_BPFTOOL)
+
 $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ)
 
 $(OUTPUT)/test_dev_cgroup: cgroup_helpers.c
index 6b7ba19be1d0475aef6b6f107cd8183c2601834a..718f59692ccbfb742287080855e5dda35a024160 100755 (executable)
@@ -2,9 +2,10 @@
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2020 SUSE LLC.
 
+# 'make -C tools/testing/selftests/bpf install' will install to SCRIPT_DIR
 SCRIPT_DIR=$(dirname $(realpath $0))
 
 # 'make -C tools/testing/selftests/bpf' will install to BPFTOOL_INSTALL_PATH
 BPFTOOL_INSTALL_PATH="$SCRIPT_DIR"/tools/sbin
-export PATH=$BPFTOOL_INSTALL_PATH:$PATH
+export PATH=$SCRIPT_DIR:$BPFTOOL_INSTALL_PATH:$PATH
 python3 -m unittest -v test_bpftool.TestBpftool