linux-stable/tools
Po-Hsu Lin a783625334 selftests: net: devlink_port_split.py: skip test if no suitable device available
[ Upstream commit 24994513ad ]

The `devlink -j port show` command output may not contain the "flavour"
key, an example from Ubuntu 22.10 s390x LPAR(5.19.0-37-generic), with
mlx4 driver and iproute2-5.15.0:
  {"port":{"pci/0001:00:00.0/1":{"type":"eth","netdev":"ens301"},
           "pci/0001:00:00.0/2":{"type":"eth","netdev":"ens301d1"},
           "pci/0002:00:00.0/1":{"type":"eth","netdev":"ens317"},
           "pci/0002:00:00.0/2":{"type":"eth","netdev":"ens317d1"}}}

This will cause a KeyError exception.

Create a validate_devlink_output() to check for this "flavour" from
devlink command output to avoid this KeyError exception. Also let
it handle the check for `devlink -j dev show` output in main().

Apart from this, if the test was not started because the max lanes of
the designated device is 0. The script will still return 0 and thus
causing a false-negative test result.

Use a found_max_lanes flag to determine if these tests were skipped
due to this reason and return KSFT_SKIP to make it more clear.

Link: https://bugs.launchpad.net/bugs/1937133
Fixes: f3348a82e7 ("selftests: net: Add port split test")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Link: https://lore.kernel.org/r/20230315165353.229590-1-po-hsu.lin@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-22 13:31:28 +01:00
..
accounting
arch parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-14 10:23:27 +01:00
bootconfig tools/bootconfig: fix single & used for logical condition 2023-03-10 09:40:10 +01:00
bpf tools bpftool: Fix compilation error with new binutils 2023-03-17 08:49:04 +01:00
build tools build: Add feature test for init_disassemble_info API changes 2023-03-17 08:49:03 +01:00
cgroup
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-02-01 08:27:29 +01:00
hv
iio tools/iio/iio_utils:fix memory leak 2023-03-11 13:57:34 +01:00
include tools include: add dis-asm-compat.h to handle version differences 2023-03-17 08:49:04 +01:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop
leds
lib libbpf: Fix alen calculation in libbpf_nla_dump_errormsg() 2023-03-10 09:39:16 +01:00
memory-model
objtool objtool: Fix memory leak in create_static_call_sections() 2023-03-11 13:57:22 +01:00
pci
pcmcia
perf tools perf: Fix compilation error with new binutils 2023-03-17 08:49:04 +01:00
power tools/power/x86/intel-speed-select: Add Emerald Rapid quirk 2023-03-10 09:39:49 +01:00
rcu
scripts
spi
testing selftests: net: devlink_port_split.py: skip test if no suitable device available 2023-03-22 13:31:28 +01:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time
tracing tools/latency-collector: Use correct size when writing queue_full_warning 2021-11-18 19:16:19 +01:00
usb
virtio tools/virtio: fix the vringh test for virtio ring changes 2023-02-22 12:57:01 +01:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:28:42 +01:00
wmi
Makefile