From: David Ahern <hidden> Date: 2018-03-01 19:09:54
Bug fixes and an enhancement for the recent forwarding tests:
- only check tc version on tc tests
- only check for mz for tests that will use it
- handle multipath tests failing with 0 packet count
- fix ping command for IPv6 on Debian jessie
- improve summary of multipath tests
BTW: who is the cruel person that made whitespace 7 spaces in these files?
David Ahern (5):
selftests: forwarding: Only check tc version for tc tests
selftests: forwarding: Only check for mz when it is needed
selftests: forwarding: Handle 0 for packet difference in multipath
tests
selftests: forwarding: Use PING6 instead of ping for ipv6 multipath
test
selftests: forwarding: Add description to the multipath tests
tools/testing/selftests/net/forwarding/lib.sh | 37 ++++++++++-------
.../selftests/net/forwarding/router_multipath.sh | 47 +++++++++++++---------
.../testing/selftests/net/forwarding/tc_actions.sh | 2 +-
.../testing/selftests/net/forwarding/tc_chains.sh | 2 +-
.../testing/selftests/net/forwarding/tc_common.sh | 3 ++
.../testing/selftests/net/forwarding/tc_flower.sh | 2 +-
.../selftests/net/forwarding/tc_shblocks.sh | 2 +-
7 files changed, 59 insertions(+), 36 deletions(-)
--
2.11.0
From: David Ahern <hidden> Date: 2018-03-01 19:09:55
Capabilities of tc command are irrelevant for router tests:
$ ./router.sh
SKIP: iproute2 too old, missing shared block support
Add a CHECK_TC flag and only check tc capabilities if set. Add flag to
tc_common.sh and have it sourced before lib.sh
Also, if the command lacks some feature the test should exit non-0.
Signed-off-by: David Ahern <redacted>
---
tools/testing/selftests/net/forwarding/lib.sh | 29 ++++++++++++++--------
.../testing/selftests/net/forwarding/tc_actions.sh | 2 +-
.../testing/selftests/net/forwarding/tc_chains.sh | 2 +-
.../testing/selftests/net/forwarding/tc_common.sh | 2 ++
.../testing/selftests/net/forwarding/tc_flower.sh | 2 +-
.../selftests/net/forwarding/tc_shblocks.sh | 2 +-
6 files changed, 24 insertions(+), 15 deletions(-)
From: David Ahern <hidden> Date: 2018-03-01 19:09:56
Add a CHECK_MZ flag and only check if mz exists when flag is set.
If it does not exist, exit non-0.
Signed-off-by: David Ahern <redacted>
---
tools/testing/selftests/net/forwarding/lib.sh | 8 +++++---
tools/testing/selftests/net/forwarding/router_multipath.sh | 1 +
tools/testing/selftests/net/forwarding/tc_common.sh | 1 +
3 files changed, 7 insertions(+), 3 deletions(-)
From: David Ahern <hidden> Date: 2018-03-01 19:09:57
If the packet stats have a difference of 0, the test output shows:
INFO: Expected ratio 2.00 Measured ratio
Runtime error (func=(main), adr=9): Divide by zero
(standard_in) 2: syntax error
(standard_in) 1: syntax error
./router_multipath.sh: line 187: test: : integer expression expected
TEST: Multipath [FAIL]
Too large discrepancy between expected and measured ratios
Handle the 0 and display a cleaner message:
INFO: Running IPv6 multipath tests
TEST: Multipath [FAIL]
Packet difference is 0
Signed-off-by: David Ahern <redacted>
---
tools/testing/selftests/net/forwarding/router_multipath.sh | 7 +++++++
1 file changed, 7 insertions(+)
From: David Ahern <hidden> Date: 2018-03-01 19:09:59
On Debian jessie ping can not handle IPv6 addresses so the command
fails. Use PING6 which is set to ping6.
Signed-off-by: David Ahern <redacted>
---
tools/testing/selftests/net/forwarding/router_multipath.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -250,7 +250,7 @@ multipath6_test()# Generate 16384 echo requests, each with a random flow label.for_in$(seq116384);do-ipvrfexecvrf-h1ping2001:db8:2::2-F0-c1-q&>/dev/null+ipvrfexecvrf-h1$PING62001:db8:2::2-F0-c1-q&>/dev/nulldonet1_rp12=$(link_stats_tx_packets_get$rp12)
@@ -193,14 +194,15 @@ multipath_eval()test"$(echo"$diff / $weights_ratio > 0.1"|bc-l)"-eq0check_err$?"Too large discrepancy between expected and measured ratios"-log_test"Multipath"+log_test"$desc"log_info"Expected ratio $weights_ratio Measured ratio $packets_ratio"} multipath4_test(){-localweight_rp12=$1-localweight_rp13=$2+localdesc="$1"+localweight_rp12=$2+localweight_rp13=$3localt0_rp12t0_rp13t1_rp12t1_rp13localpackets_rp12packets_rp13localhash_policy
On Thu, Mar 01, 2018 at 11:09:42AM -0800, David Ahern wrote:
Bug fixes and an enhancement for the recent forwarding tests:
- only check tc version on tc tests
- only check for mz for tests that will use it
- handle multipath tests failing with 0 packet count
- fix ping command for IPv6 on Debian jessie
- improve summary of multipath tests
BTW: who is the cruel person that made whitespace 7 spaces in these files?
I see this in some functions in router_multipath.sh . Not sure how that
happened... Will be more careful in the future.
On Thu, Mar 01, 2018 at 11:09:44AM -0800, David Ahern wrote:
Add a CHECK_MZ flag and only check if mz exists when flag is set.
If it does not exist, exit non-0.
Signed-off-by: David Ahern <redacted>
The only test that doesn't require it is router.sh so I'm not sure it's
worth the effort. If you still want to keep the patch then
bridge_vlan_aware.sh needs to be patched as well.
On Thu, Mar 01, 2018 at 11:09:45AM -0800, David Ahern wrote:
If the packet stats have a difference of 0, the test output shows:
INFO: Expected ratio 2.00 Measured ratio
Runtime error (func=(main), adr=9): Divide by zero
(standard_in) 2: syntax error
(standard_in) 1: syntax error
./router_multipath.sh: line 187: test: : integer expression expected
TEST: Multipath [FAIL]
Too large discrepancy between expected and measured ratios
Handle the 0 and display a cleaner message:
INFO: Running IPv6 multipath tests
TEST: Multipath [FAIL]
Packet difference is 0
Signed-off-by: David Ahern <redacted>
On Thu, Mar 01, 2018 at 11:09:46AM -0800, David Ahern wrote:
On Debian jessie ping can not handle IPv6 addresses so the command
fails. Use PING6 which is set to ping6.
Signed-off-by: David Ahern <redacted>
Yep, I forgot to replace that one.
Reviewed-by: Ido Schimmel <redacted>
BTW, I have a patch to convert the IPv6 multipath test to use mz. I'm
waiting for your L4 hash patches to be accepted :)
From: David Ahern <hidden> Date: 2018-03-01 19:43:45
On 3/1/18 12:39 PM, Ido Schimmel wrote:
On Thu, Mar 01, 2018 at 11:09:46AM -0800, David Ahern wrote:
quoted
On Debian jessie ping can not handle IPv6 addresses so the command
fails. Use PING6 which is set to ping6.
Signed-off-by: David Ahern <redacted>
Yep, I forgot to replace that one.
Reviewed-by: Ido Schimmel <redacted>
BTW, I have a patch to convert the IPv6 multipath test to use mz. I'm
waiting for your L4 hash patches to be accepted :)
Can you forward it? That is what is driving this series.
On Thu, Mar 01, 2018 at 12:43:42PM -0700, David Ahern wrote:
On 3/1/18 12:39 PM, Ido Schimmel wrote:
quoted
On Thu, Mar 01, 2018 at 11:09:46AM -0800, David Ahern wrote:
quoted
On Debian jessie ping can not handle IPv6 addresses so the command
fails. Use PING6 which is set to ping6.
Signed-off-by: David Ahern <redacted>
Yep, I forgot to replace that one.
Reviewed-by: Ido Schimmel <redacted>
BTW, I have a patch to convert the IPv6 multipath test to use mz. I'm
waiting for your L4 hash patches to be accepted :)
Can you forward it? That is what is driving this series.
Feel free to submit with your patches (sorry about the spaces!):
@@ -240,10 +243,8 @@ multipath6_test()t0_rp12=$(link_stats_tx_packets_get$rp12)t0_rp13=$(link_stats_tx_packets_get$rp13)-# Generate 16384 echo requests, each with a random flow label.-for_in$(seq116384);do-ipvrfexecvrf-h1ping2001:db8:2::2-F0-c1-q&>/dev/null-done+$MZ$h1-6-q-p64-A2001:db8:1::2-B2001:db8:2::2-d1msec\+-tudp"sp=1024,dp=0-32768"t1_rp12=$(link_stats_tx_packets_get$rp12)t1_rp13=$(link_stats_tx_packets_get$rp13)
On Thu, Mar 01, 2018 at 11:09:43AM -0800, David Ahern wrote:
Capabilities of tc command are irrelevant for router tests:
$ ./router.sh
SKIP: iproute2 too old, missing shared block support
Add a CHECK_TC flag and only check tc capabilities if set. Add flag to
tc_common.sh and have it sourced before lib.sh
Also, if the command lacks some feature the test should exit non-0.
Signed-off-by: David Ahern <redacted>
---
tools/testing/selftests/net/forwarding/lib.sh | 29 ++++++++++++++--------
.../testing/selftests/net/forwarding/tc_actions.sh | 2 +-
.../testing/selftests/net/forwarding/tc_chains.sh | 2 +-
.../testing/selftests/net/forwarding/tc_common.sh | 2 ++
.../testing/selftests/net/forwarding/tc_flower.sh | 2 +-
.../selftests/net/forwarding/tc_shblocks.sh | 2 +-
bridge_vlan_aware.sh also uses tc to check flooding and learning. Looks
good otherwise.
Reviewed-by: Ido Schimmel <redacted>
Thanks, David!
From: David Ahern <hidden> Date: 2018-03-01 21:44:13
On 3/1/18 12:36 PM, Ido Schimmel wrote:
On Thu, Mar 01, 2018 at 11:09:44AM -0800, David Ahern wrote:
quoted
Add a CHECK_MZ flag and only check if mz exists when flag is set.
If it does not exist, exit non-0.
Signed-off-by: David Ahern <redacted>
The only test that doesn't require it is router.sh so I'm not sure it's
worth the effort. If you still want to keep the patch then
bridge_vlan_aware.sh needs to be patched as well.