File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
tools/testing/selftests/drivers/net Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 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
@@ -61,7 +62,7 @@ def check_traffic_flowing():
61
62
try :
62
63
stats = get_stats ()
63
64
except NlError as e :
64
- if e .nl_msg .error == - 95 :
65
+ if e .nl_msg .error == - errno . EOPNOTSUPP :
65
66
stats = {}
66
67
else :
67
68
raise
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def check_pause(cfg) -> None:
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,7 +35,7 @@ def check_fec(cfg) -> None:
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,7 +120,7 @@ def qstat_by_ifindex(cfg) -> None:
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
You can’t perform that action at this time.
0 commit comments