Re: [PATCH bpf-next v3 5/5] selftests/bpf: Add test for "bpftool feature" command

From: Michal Rostecki
Date: Wed Feb 26 2020 - 10:42:18 EST


On 2/26/20 4:34 PM, Daniel Borkmann wrote:
> Ptal, when running the test I'm getting the following error:
>
> root@tank:~/bpf-next/tools/testing/selftests/bpf# ./test_bpftool.sh
> 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
>
> ======================================================================
> ERROR: test_feature_dev_json (test_bpftool.TestBpftool)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> Â File "/root/bpf-next/tools/testing/selftests/bpf/test_bpftool.py",
> line 58, in wrapper
> ÂÂÂ return f(*args, iface, **kwargs)
> Â File "/root/bpf-next/tools/testing/selftests/bpf/test_bpftool.py",
> line 83, in test_feature_dev_json
> ÂÂÂ res = bpftool_json(["feature", "probe", "dev", iface])
> Â File "/root/bpf-next/tools/testing/selftests/bpf/test_bpftool.py",
> line 43, in bpftool_json
> ÂÂÂ res = _bpftool(args)
> Â File "/root/bpf-next/tools/testing/selftests/bpf/test_bpftool.py",
> line 34, in _bpftool
> ÂÂÂ res = subprocess.run(_args, capture_output=True)
> Â File "/usr/lib/python3.6/subprocess.py", line 423, in run
> ÂÂÂ with Popen(*popenargs, **kwargs) as process:
> TypeError: __init__() got an unexpected keyword argument 'capture_output'

Seems like that kwarg in Popen was added in Python 3.7. I will drop it
and use the older way of getting combined output. Thanks for pointing
that out!