Skip to content

Commit

Permalink
tests: Remove maximum version kernel check.
Browse files Browse the repository at this point in the history
The macro 'OVS_CHECK_KERNEL' was checking for maximum supported kernel
version.  This means checks like 'OVS_CHECK_KERNEL(3, 10, 4, 18)'
in various tests need to be updated when each new kernel version is
supported. This is unnecessary as these tests are expected to continue
to work in later kernel versions.

Fix this by changing the macro to check for minimum version only and
update the macro name accordingly.

This patch does not make any possible corrections to the indicated minimum
kernel version specified by the callers of the macro.

Reviewed-by: Yifeng Sun <[email protected]>
Signed-off-by: Darrell Ball <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
darball1 authored and blp committed Mar 25, 2019
1 parent 304c807 commit e06c44a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
12 changes: 5 additions & 7 deletions tests/system-kmod-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,19 @@ m4_define([DPCTL_CHECK_FRAGMENTATION_FAIL],

])

# OVS_CHECK_KERNEL([minversion], [minsublevel], [maxversion], [maxsublevel])
# OVS_CHECK_MIN_KERNEL([minversion], [minsublevel])
#
# Check if kernel version falls between minversion.minsublevel and
# maxversion.maxsublevel, skip this test if it is not.
m4_define([OVS_CHECK_KERNEL],
# Skip test if kernel version falls below minversion.minsublevel
m4_define([OVS_CHECK_MIN_KERNEL],
[
version=$(uname -r | sed -e 's/\./ /g' | awk '{print $ 1}')
sublevel=$(uname -r | sed -e 's/\./ /g' | awk '{print $ 2}')
AT_SKIP_IF([test $version -lt $1 || ( test $version -eq $1 && test $sublevel -lt $2 ) || test $version -gt $3 || ( test $version -eq $3 && test $sublevel -gt $4 )])
AT_SKIP_IF([test $version -lt $1 || ( test $version -eq $1 && test $sublevel -lt $2 )])
])

# OVS_CHECK_KERNEL_EXCL([minversion], [minsublevel], [maxversion], [maxsublevel])
#
# Check that kernel version doesn't fall between minversion.minsublevel and
# maxversion.maxsublevel, skip this test if it is.
# Skip test if kernel version falls between minversion.minsublevel and maxversion.maxsublevel
m4_define([OVS_CHECK_KERNEL_EXCL],
[
version=$(uname -r | sed -e 's/\./ /g' | awk '{print $ 1}')
Expand Down
12 changes: 6 additions & 6 deletions tests/system-traffic.at
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over gre tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)

OVS_TRAFFIC_VSWITCHD_START()
AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"])
Expand Down Expand Up @@ -667,7 +667,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over erspan v1 tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)

OVS_TRAFFIC_VSWITCHD_START()
AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"])
Expand Down Expand Up @@ -719,7 +719,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over erspan v2 tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)

OVS_TRAFFIC_VSWITCHD_START()
AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"])
Expand Down Expand Up @@ -772,7 +772,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over ip6erspan v1 tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)

OVS_TRAFFIC_VSWITCHD_START()
AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"])
Expand Down Expand Up @@ -827,7 +827,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over ip6erspan v2 tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)

OVS_TRAFFIC_VSWITCHD_START()
AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"])
Expand Down Expand Up @@ -1066,7 +1066,7 @@ dnl ns1: connect to br0, with IP:10.1.1.2
dnl br-underlay: with IP: 172.31.1.100
dnl ns0: connect to br-underlay, with IP: 10.1.1.1
AT_SETUP([datapath - truncate and output to gre tunnel by simulated packets])
OVS_CHECK_KERNEL(3, 10, 4, 18)
OVS_CHECK_MIN_KERNEL(3, 10)
AT_SKIP_IF([test $HAVE_NC = no])
OVS_TRAFFIC_VSWITCHD_START()

Expand Down
4 changes: 2 additions & 2 deletions tests/system-userspace-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ AT_CHECK([ovs-appctl dpctl/ipf-get-status -m | FORMAT_FRAG_LIST()], [], [dnl
])
])

# OVS_CHECK_KERNEL([minversion], [maxversion], [minsublevel], [maxsublevel])
# OVS_CHECK_MIN_KERNEL([minversion], [maxversion])
#
# The userspace skips all tests that check kernel version.
m4_define([OVS_CHECK_KERNEL],
m4_define([OVS_CHECK_MIN_KERNEL],
[
AT_SKIP_IF([:])
])
Expand Down

0 comments on commit e06c44a

Please sign in to comment.