• Li Zhijian's avatar
    selftests/bpf: Add default bpftool built by selftests to PATH · 7a3bdca2
    Li Zhijian authored
    For 'make run_tests':
    selftests will build bpftool into tools/testing/selftests/bpf/tools/sbin/bpftool
    by default.
    
    ==================
    root@lkp-skl-d01 /opt/rootfs/v5.14-rc4# make -C tools/testing/selftests/bpf run_tests
    make: Entering directory '/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf'
      MKDIR    include
      MKDIR    libbpf
      MKDIR    bpftool
    [...]
      GEN     /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/profiler.skel.h
      CC      /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/prog.o
      GEN     /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/pid_iter.skel.h
      CC      /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/pids.o
      LINK    /opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/tools/build/bpftool/bpftool
      INSTALL bpftool
      GEN      vmlinux.h
    [...]
     # test_feature_dev_json (test_bpftool.TestBpftool) ... ERROR
     # test_feature_kernel (test_bpftool.TestBpftool) ... ERROR
     # test_feature_kernel_full (test_bpftool.TestBpftool) ... ERROR
     # test_feature_kernel_full_vs_not_full (test_bpftool.TestBpftool) ... ERROR
     # test_feature_macros (test_bpftool.TestBpftool) ... Error: bug: failed to retrieve CAP_BPF status: Invalid argument
     # ERROR
     #
     # ======================================================================
     # ERROR: test_feature_dev_json (test_bpftool.TestBpftool)
     # ----------------------------------------------------------------------
     # Traceback (most recent call last):
     #   File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 57, in wrapper
     #     return f(*args, iface, **kwargs)
     #   File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 82, in test_feature_dev_json
     #     res = bpftool_json(["feature", "probe", "dev", iface])
     #   File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 42, in bpftool_json
     #     res = _bpftool(args)
     #   File "/opt/rootfs/v5.14-rc4/tools/testing/selftests/bpf/test_bpftool.py", line 34, in _bpftool
     #     return subprocess.check_output(_args)
     #   File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
     #     **kwargs).stdout
     #   File "/usr/lib/python3.7/subprocess.py", line 487, in run
     #     output=stdout, stderr=stderr)
     # subprocess.CalledProcessError: Command '['bpftool', '-j', 'feature', 'probe', 'dev', 'dummy0']' returned non-zero exit status 255.
     #
    ==================
    Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Acked-by: default avatarSong Liu <songliubraving@fb.com>
    Link: https://lore.kernel.org/bpf/20210820015556.23276-4-lizhijian@cn.fujitsu.com
    7a3bdca2
test_bpftool.sh 328 Bytes