Message ID | ZimTlf_ISC2n8snQ@LQ3V64L9R2 (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ynl: maybe minor bug? | expand |
On Wed, 24 Apr 2024 16:19:49 -0700 Joe Damato wrote: > I'm not sure whether: > > 1. tools/net/ynl/lib/ynl.py should be raising NlError when there is an > extack in this case (I think this is probably the way to go?), or > > 2. the tests should be changed so that they don't expect an exception to be > raised but (ideally?) hide the warning report from tools/net/ynl/lib/ynl.py > when the warning is expected. > > I don't know python at all so this is definitely wrong, but here's a small > change I made to fix the test (a similar change was made for the test which > follows). Sorry about this, we pushed the related fix to the net tree, to get it to Linus sooner: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=a44f2eb106a46f2275a79de54ce0ea63e4f3d8c8 You can cherry-pick that locally, perhaps. net will get merged into net-next tomorrow, I should have waited before extending the test :(
diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py index 7a7b16b180e2..d9f5d1f3ed34 100755 --- a/tools/testing/selftests/drivers/net/stats.py +++ b/tools/testing/selftests/drivers/net/stats.py @@ -115,9 +115,8 @@ def qstat_by_ifindex(cfg) -> None: ksft_eq(cm.exception.nl_msg.extack['bad-attr'], '.ifindex') # loopback has no stats - with ksft_raises(NlError) as cm: - netfam.qstats_get({"ifindex": 1}, dump=True) - ksft_eq(cm.exception.nl_msg.error, -95) + stats = netfam.qstats_get({"ifindex": 1}, dump=True) + ksft_eq(cm.exception.nl_msg.error, -34) ksft_eq(cm.exception.nl_msg.extack['bad-attr'], '.ifindex')