[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW6Bq==H9qdjCQtuQiaUz6+oqgeMTTnseCUwS5WuhH1TNQ@mail.gmail.com>
Date: Thu, 19 Aug 2021 15:13:24 -0700
From: Song Liu <song@...nel.org>
To: Li Zhijian <lizhijian@...fujitsu.com>
Cc: Shuah Khan <shuah@...nel.org>, linux-kselftest@...r.kernel.org,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
KP Singh <kpsingh@...nel.org>,
open list <linux-kernel@...r.kernel.org>, philip.li@...el.com,
yifeix.zhu@...el.com
Subject: Re: [PATCH 2/3] selftests/bpf: add default bpftool built by selftests
to PATH
On Thu, Aug 19, 2021 at 12:27 AM Li Zhijian <lizhijian@...fujitsu.com> wrote:
>
> For 'make run_tests':
> selftests will build bpftool into tools/testing/selftests/bpf/tools/sbin/bpftool
> by default.
>
> ==================
> root@...-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: Li Zhijian <lizhijian@...fujitsu.com>
Acked-by: Song Liu <songliubraving@...com>
> ---
> tools/testing/selftests/bpf/test_bpftool.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/test_bpftool.sh b/tools/testing/selftests/bpf/test_bpftool.sh
> index 66690778e36d..6b7ba19be1d0 100755
> --- a/tools/testing/selftests/bpf/test_bpftool.sh
> +++ b/tools/testing/selftests/bpf/test_bpftool.sh
> @@ -2,4 +2,9 @@
> # SPDX-License-Identifier: GPL-2.0
> # Copyright (c) 2020 SUSE LLC.
>
> +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
> python3 -m unittest -v test_bpftool.TestBpftool
> --
> 2.32.0
>
>
>
Powered by blists - more mailing lists