Skip to content

Commit 4697381

Browse files
kuba-mooPaolo Abeni
authored andcommitted
selftests: netdevsim: correct expected FEC strings
ethtool CLI has changed its output. Make the test compatible. Signed-off-by: Jakub Kicinski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2c4ca79 commit 4697381

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tools/testing/selftests/drivers/net/netdevsim/ethtool-fec.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,58 @@ NSIM_NETDEV=$(make_netdev)
88

99
set -o pipefail
1010

11+
# Since commit 2b3ddcb35357 ("ethtool: fec: Change the prompt ...")
12+
# in ethtool CLI the Configured lines start with Supported/Configured.
13+
configured=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2 | head -1 | cut -d' ' -f1)
14+
1115
# netdevsim starts out with None/None
1216
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
13-
check $? "$s" "Configured FEC encodings: None
17+
check $? "$s" "$configured FEC encodings: None
1418
Active FEC encoding: None"
1519

1620
# Test Auto
1721
$ETHTOOL --set-fec $NSIM_NETDEV encoding auto
1822
check $?
1923
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
20-
check $? "$s" "Configured FEC encodings: Auto
24+
check $? "$s" "$configured FEC encodings: Auto
2125
Active FEC encoding: Off"
2226

2327
# Test case in-sensitivity
2428
for o in off Off OFF; do
2529
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
2630
check $?
2731
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
28-
check $? "$s" "Configured FEC encodings: Off
32+
check $? "$s" "$configured FEC encodings: Off
2933
Active FEC encoding: Off"
3034
done
3135

3236
for o in BaseR baser BAser; do
3337
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
3438
check $?
3539
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
36-
check $? "$s" "Configured FEC encodings: BaseR
40+
check $? "$s" "$configured FEC encodings: BaseR
3741
Active FEC encoding: BaseR"
3842
done
3943

4044
for o in llrs rs; do
4145
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
4246
check $?
4347
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
44-
check $? "$s" "Configured FEC encodings: ${o^^}
48+
check $? "$s" "$configured FEC encodings: ${o^^}
4549
Active FEC encoding: ${o^^}"
4650
done
4751

4852
# Test mutliple bits
4953
$ETHTOOL --set-fec $NSIM_NETDEV encoding rs llrs
5054
check $?
5155
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
52-
check $? "$s" "Configured FEC encodings: RS LLRS
56+
check $? "$s" "$configured FEC encodings: RS LLRS
5357
Active FEC encoding: LLRS"
5458

5559
$ETHTOOL --set-fec $NSIM_NETDEV encoding rs off auto
5660
check $?
5761
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
58-
check $? "$s" "Configured FEC encodings: Auto Off RS
62+
check $? "$s" "$configured FEC encodings: Auto Off RS
5963
Active FEC encoding: RS"
6064

6165
# Make sure other link modes are rejected

0 commit comments

Comments
 (0)