@@ -8,54 +8,58 @@ NSIM_NETDEV=$(make_netdev)
88
99set -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
1216s=$( $ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
13- check $? " $s " " Configured FEC encodings: None
17+ check $? " $s " " $configured FEC encodings: None
1418Active FEC encoding: None"
1519
1620# Test Auto
1721$ETHTOOL --set-fec $NSIM_NETDEV encoding auto
1822check $?
1923s=$( $ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
20- check $? " $s " " Configured FEC encodings: Auto
24+ check $? " $s " " $configured FEC encodings: Auto
2125Active FEC encoding: Off"
2226
2327# Test case in-sensitivity
2428for 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
2933Active FEC encoding: Off"
3034done
3135
3236for 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
3741Active FEC encoding: BaseR"
3842done
3943
4044for 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^^}
4549Active FEC encoding: ${o^^} "
4650done
4751
4852# Test mutliple bits
4953$ETHTOOL --set-fec $NSIM_NETDEV encoding rs llrs
5054check $?
5155s=$( $ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
52- check $? " $s " " Configured FEC encodings: RS LLRS
56+ check $? " $s " " $configured FEC encodings: RS LLRS
5357Active FEC encoding: LLRS"
5458
5559$ETHTOOL --set-fec $NSIM_NETDEV encoding rs off auto
5660check $?
5761s=$( $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
5963Active FEC encoding: RS"
6064
6165# Make sure other link modes are rejected
0 commit comments