Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: net: ksft: replace 95 with errno.EOPNOTSUPP

Petr suggested to use errno.EOPNOTSUPP instead of hard-coded 95
in the new test case. Adjust existing ones to match this style.

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20240802000309.2368-3-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Stanislav Fomichev and committed by
Jakub Kicinski
a48395f2 f8793068

+5 -4
+2 -1
tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
··· 1 1 #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + import errno 4 5 import time 5 6 import os 6 7 from lib.py import ksft_run, ksft_exit, ksft_pr ··· 62 61 try: 63 62 stats = get_stats() 64 63 except NlError as e: 65 - if e.nl_msg.error == -95: 64 + if e.nl_msg.error == -errno.EOPNOTSUPP: 66 65 stats = {} 67 66 else: 68 67 raise
+3 -3
tools/testing/selftests/drivers/net/stats.py
··· 20 20 try: 21 21 ethnl.pause_get({"header": {"dev-index": cfg.ifindex}}) 22 22 except NlError as e: 23 - if e.error == 95: 23 + if e.error == errno.EOPNOTSUPP: 24 24 raise KsftXfailEx("pause not supported by the device") 25 25 raise 26 26 ··· 35 35 try: 36 36 ethnl.fec_get({"header": {"dev-index": cfg.ifindex}}) 37 37 except NlError as e: 38 - if e.error == 95: 38 + if e.error == errno.EOPNOTSUPP: 39 39 raise KsftXfailEx("FEC not supported by the device") 40 40 raise 41 41 ··· 120 120 # loopback has no stats 121 121 with ksft_raises(NlError) as cm: 122 122 netfam.qstats_get({"ifindex": 1}, dump=True) 123 - ksft_eq(cm.exception.nl_msg.error, -95) 123 + ksft_eq(cm.exception.nl_msg.error, -errno.EOPNOTSUPP) 124 124 ksft_eq(cm.exception.nl_msg.extack['bad-attr'], '.ifindex') 125 125 126 126 # Try to get stats for lowest unused ifindex but not 0