]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: net-drv: exercise queue stats when the device is down
authorStanislav Fomichev <sdf@fomichev.me>
Fri, 2 Aug 2024 00:03:07 +0000 (17:03 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 2 Aug 2024 23:09:27 +0000 (16:09 -0700)
commitab1000976cc7de8e57bdef811dfcfcb6c17a929f
tree08928f99fb8d13e4cdb6a74755c42336b0a8454e
parent49675f5bdf9ae2624b430dafda4cb29024521625
selftests: net-drv: exercise queue stats when the device is down

Verify that total device stats don't decrease after it has been turned down.
Also make sure the device doesn't crash when we access per-queue stats
when it's down (in case it tries to access some pointers that are NULL).

  KTAP version 1
  1..5
  ok 1 stats.check_pause
  ok 2 stats.check_fec
  ok 3 stats.pkt_byte_sum
  ok 4 stats.qstat_by_ifindex
  ok 5 stats.check_down
  # Totals: pass:5 fail:0 xfail:0 xpass:0 skip:0 error:0

v3:
- use errno.EOPNOTSUPP (Petr)
- move qstat[0] under try (Petr)

v2:
- KTAP output formatting (Jakub)
- defer instead of try/finally (Jakub)
- disappearing stats is an error (Jakub)
- ksft_ge instead of open coding (Jakub)

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20240802000309.2368-1-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/stats.py