Skip to content

Commit

Permalink
tests: Skip tests when ethtool is unavailable.
Browse files Browse the repository at this point in the history
In a freshly created container or virtual machine, forgetting to install
ethtool is quite common.
Yet, don't fail tests if this tool is missing.

Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand committed Jul 12, 2024
1 parent 060a822 commit b0126e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/system-afxdp-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ m4_define([OVS_CHECK_8021AD],
#
# Disable TX offloads and VLAN offloads for veths used in AF_XDP.
m4_define([CONFIGURE_VETH_OFFLOADS],
[AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
[AT_SKIP_IF([test $HAVE_ETHTOOL = no])
AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
AT_CHECK([ethtool -K $1 txvlan off], [0], [ignore], [ignore])
]
)
3 changes: 2 additions & 1 deletion tests/system-dpdk-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ m4_define([OVS_CHECK_TC_QDISC],


m4_define([CONFIGURE_VETH_OFFLOADS],
[AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
[AT_SKIP_IF([test $HAVE_ETHTOOL = no])
AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
AT_CHECK([ethtool -K $1 txvlan off], [0], [ignore], [ignore])]
)
1 change: 1 addition & 0 deletions tests/system-traffic.at
Original file line number Diff line number Diff line change
Expand Up @@ -2326,6 +2326,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - netdev offload software fallback])
AT_SKIP_IF([test $HAVE_ETHTOOL = no])
AT_SKIP_IF([test $HAVE_NC = no])
OVS_TRAFFIC_VSWITCHD_START()

Expand Down
1 change: 1 addition & 0 deletions tests/system-tso-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START],
#
# Enable TCP segmentation offload and scatter-gather for veths.
m4_define([CONFIGURE_VETH_OFFLOADS],
[AT_SKIP_IF([test $HAVE_ETHTOOL = no])]
[AT_CHECK([ethtool -K $1 sg on], [0], [ignore], [ignore])]
[AT_CHECK([ethtool -K $1 tso on], [0], [ignore], [ignore])]
)
Expand Down
1 change: 1 addition & 0 deletions tests/system-userspace-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ $1";/netdev_linux.*obtaining netdev stats via vport failed/d
# This is a workaround, and should be removed when offloads are properly
# supported in netdev-linux.
m4_define([CONFIGURE_VETH_OFFLOADS],
[AT_SKIP_IF([test $HAVE_ETHTOOL = no])]
[AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])]
)

Expand Down

0 comments on commit b0126e4

Please sign in to comment.