diff mbox series

[ovs-dev,3/3] system-afxdp.at: Add test for infinite re-addition of failed ports.

Message ID 20191207144618.14124-4-i.maximets@ovn.org
State Accepted
Delegated to: Ilya Maximets
Headers show
Series dpif-netdev: Avoid infinite re-addition of misconfigured ports. | expand

Commit Message

Ilya Maximets Dec. 7, 2019, 2:46 p.m. UTC
New file created for AF_XDP specific tests.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 tests/automake.mk               |  3 ++-
 tests/system-afxdp-testsuite.at |  1 +
 tests/system-afxdp.at           | 24 ++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 tests/system-afxdp.at

Comments

William Tu Dec. 9, 2019, 8:42 p.m. UTC | #1
On Sat, Dec 07, 2019 at 03:46:18PM +0100, Ilya Maximets wrote:
> New file created for AF_XDP specific tests.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
tested and LGTM, one minor comment.

Acked-by: William Tu <u9012063@gmail.com>
> ---
>  tests/automake.mk               |  3 ++-
>  tests/system-afxdp-testsuite.at |  1 +
>  tests/system-afxdp.at           | 24 ++++++++++++++++++++++++
>  3 files changed, 27 insertions(+), 1 deletion(-)
>  create mode 100644 tests/system-afxdp.at
> 
> diff --git a/tests/automake.mk b/tests/automake.mk
> index 4bf8f00d5..529eab54e 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -156,7 +156,8 @@ SYSTEM_USERSPACE_TESTSUITE_AT = \
>  SYSTEM_AFXDP_TESTSUITE_AT = \
>  	tests/system-userspace-macros.at \
>  	tests/system-afxdp-testsuite.at \
> -	tests/system-afxdp-macros.at
> +	tests/system-afxdp-macros.at \
> +	tests/system-afxdp.at
>  
>  SYSTEM_TESTSUITE_AT = \
>  	tests/system-common-macros.at \
> diff --git a/tests/system-afxdp-testsuite.at b/tests/system-afxdp-testsuite.at
> index 9b7a29066..22fecf063 100644
> --- a/tests/system-afxdp-testsuite.at
> +++ b/tests/system-afxdp-testsuite.at
> @@ -24,3 +24,4 @@ m4_include([tests/system-userspace-macros.at])
>  m4_include([tests/system-afxdp-macros.at])
>  
>  m4_include([tests/system-traffic.at])
> +m4_include([tests/system-afxdp.at])
should we move system-afxdp.at before system-traffic?
So these more basic test cases get triggered first.

William
Ilya Maximets Dec. 18, 2019, 12:34 a.m. UTC | #2
On 09.12.2019 21:42, William Tu wrote:
> On Sat, Dec 07, 2019 at 03:46:18PM +0100, Ilya Maximets wrote:
>> New file created for AF_XDP specific tests.
>>
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> tested and LGTM, one minor comment.
> 
> Acked-by: William Tu <u9012063@gmail.com>
>> ---
>>  tests/automake.mk               |  3 ++-
>>  tests/system-afxdp-testsuite.at |  1 +
>>  tests/system-afxdp.at           | 24 ++++++++++++++++++++++++
>>  3 files changed, 27 insertions(+), 1 deletion(-)
>>  create mode 100644 tests/system-afxdp.at
>>
>> diff --git a/tests/automake.mk b/tests/automake.mk
>> index 4bf8f00d5..529eab54e 100644
>> --- a/tests/automake.mk
>> +++ b/tests/automake.mk
>> @@ -156,7 +156,8 @@ SYSTEM_USERSPACE_TESTSUITE_AT = \
>>  SYSTEM_AFXDP_TESTSUITE_AT = \
>>  	tests/system-userspace-macros.at \
>>  	tests/system-afxdp-testsuite.at \
>> -	tests/system-afxdp-macros.at
>> +	tests/system-afxdp-macros.at \
>> +	tests/system-afxdp.at
>>  
>>  SYSTEM_TESTSUITE_AT = \
>>  	tests/system-common-macros.at \
>> diff --git a/tests/system-afxdp-testsuite.at b/tests/system-afxdp-testsuite.at
>> index 9b7a29066..22fecf063 100644
>> --- a/tests/system-afxdp-testsuite.at
>> +++ b/tests/system-afxdp-testsuite.at
>> @@ -24,3 +24,4 @@ m4_include([tests/system-userspace-macros.at])
>>  m4_include([tests/system-afxdp-macros.at])
>>  
>>  m4_include([tests/system-traffic.at])
>> +m4_include([tests/system-afxdp.at])
> should we move system-afxdp.at before system-traffic?
> So these more basic test cases get triggered first.

This might make sense.  I thought about this before sending the patch.
Will change before applying.
William Tu Dec. 18, 2019, 3:18 a.m. UTC | #3
On Tue, Dec 17, 2019 at 4:34 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 09.12.2019 21:42, William Tu wrote:
> > On Sat, Dec 07, 2019 at 03:46:18PM +0100, Ilya Maximets wrote:
> >> New file created for AF_XDP specific tests.
> >>
> >> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> > tested and LGTM, one minor comment.
> >
> > Acked-by: William Tu <u9012063@gmail.com>
> >> ---
> >>  tests/automake.mk               |  3 ++-
> >>  tests/system-afxdp-testsuite.at |  1 +
> >>  tests/system-afxdp.at           | 24 ++++++++++++++++++++++++
> >>  3 files changed, 27 insertions(+), 1 deletion(-)
> >>  create mode 100644 tests/system-afxdp.at
> >>
> >> diff --git a/tests/automake.mk b/tests/automake.mk
> >> index 4bf8f00d5..529eab54e 100644
> >> --- a/tests/automake.mk
> >> +++ b/tests/automake.mk
> >> @@ -156,7 +156,8 @@ SYSTEM_USERSPACE_TESTSUITE_AT = \
> >>  SYSTEM_AFXDP_TESTSUITE_AT = \
> >>      tests/system-userspace-macros.at \
> >>      tests/system-afxdp-testsuite.at \
> >> -    tests/system-afxdp-macros.at
> >> +    tests/system-afxdp-macros.at \
> >> +    tests/system-afxdp.at
> >>
> >>  SYSTEM_TESTSUITE_AT = \
> >>      tests/system-common-macros.at \
> >> diff --git a/tests/system-afxdp-testsuite.at b/tests/system-afxdp-testsuite.at
> >> index 9b7a29066..22fecf063 100644
> >> --- a/tests/system-afxdp-testsuite.at
> >> +++ b/tests/system-afxdp-testsuite.at
> >> @@ -24,3 +24,4 @@ m4_include([tests/system-userspace-macros.at])
> >>  m4_include([tests/system-afxdp-macros.at])
> >>
> >>  m4_include([tests/system-traffic.at])
> >> +m4_include([tests/system-afxdp.at])
> > should we move system-afxdp.at before system-traffic?
> > So these more basic test cases get triggered first.
>
> This might make sense.  I thought about this before sending the patch.
> Will change before applying.

OK thanks!
diff mbox series

Patch

diff --git a/tests/automake.mk b/tests/automake.mk
index 4bf8f00d5..529eab54e 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -156,7 +156,8 @@  SYSTEM_USERSPACE_TESTSUITE_AT = \
 SYSTEM_AFXDP_TESTSUITE_AT = \
 	tests/system-userspace-macros.at \
 	tests/system-afxdp-testsuite.at \
-	tests/system-afxdp-macros.at
+	tests/system-afxdp-macros.at \
+	tests/system-afxdp.at
 
 SYSTEM_TESTSUITE_AT = \
 	tests/system-common-macros.at \
diff --git a/tests/system-afxdp-testsuite.at b/tests/system-afxdp-testsuite.at
index 9b7a29066..22fecf063 100644
--- a/tests/system-afxdp-testsuite.at
+++ b/tests/system-afxdp-testsuite.at
@@ -24,3 +24,4 @@  m4_include([tests/system-userspace-macros.at])
 m4_include([tests/system-afxdp-macros.at])
 
 m4_include([tests/system-traffic.at])
+m4_include([tests/system-afxdp.at])
diff --git a/tests/system-afxdp.at b/tests/system-afxdp.at
new file mode 100644
index 000000000..e4451624f
--- /dev/null
+++ b/tests/system-afxdp.at
@@ -0,0 +1,24 @@ 
+AT_BANNER([AF_XDP])
+
+AT_SETUP([AF_XDP - infinite re-addition of failed ports])
+AT_KEYWORDS([afxdp infinite])
+OVS_TRAFFIC_VSWITCHD_START()
+
+AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
+
+ADD_NAMESPACES(at_ns0, at_ns1)
+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
+
+AT_CHECK([ovs-vsctl del-port ovs-p0])
+AT_CHECK([ovs-vsctl add-port br0 ovs-p0 -- \
+                    set interface ovs-p0 type=afxdp options:n_rxq=42],
+         [0], [], [stderr])
+OVS_WAIT_UNTIL([grep "ovs-p0: could not set configuration" ovs-vswitchd.log])
+sleep 5
+AT_CHECK([grep "ovs-p0: could not set configuration" ovs-vswitchd.log | wc -l],
+         [0], [1
+])
+
+OVS_TRAFFIC_VSWITCHD_STOP(["/ovs-p0: Too big 'n_rxq'/d
+/ovs-p0: could not set configuration/d"])
+AT_CLEANUP