On Thu, Apr 20, 2023 at 6:23 PM Xavier Simonart <[email protected]> wrote:

> The tests were randomly failing as there is no guarentee that
> 15 nc will reach different load balancers.
> Also, running 15 nc made the test quite slow.
> Fixed by running loops of 5 nc, and then checking results.
> Test duration decreased by 15 to 20 seconds.
>
> Signed-off-by: Xavier Simonart <[email protected]>
> ---
>  tests/system-ovn-kmod.at | 112 +++++++++++++++++++--------------------
>  1 file changed, 56 insertions(+), 56 deletions(-)
>
> diff --git a/tests/system-ovn-kmod.at b/tests/system-ovn-kmod.at
> index 981cc598c..e54b458fb 100644
> --- a/tests/system-ovn-kmod.at
> +++ b/tests/system-ovn-kmod.at
> @@ -332,14 +332,14 @@ OVS_WAIT_UNTIL([ovs-ofctl -O OpenFlow13 dump-groups
> br-int | \
>  grep 'nat(dst=192.168.2.2:80)'])
>
>  dnl Should work with the virtual IP address through NAT
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([alice1], [nc -z 172.16.1.100 8080])
> -done
> -
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.1.100) |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([alice1], [nc -z 172.16.1.100 8080])
> +    done
> +
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.1.100) | \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=172.16.1.2,dst=172.16.1.100,sport=<cleared>,dport=<cleared>),reply=(src=192.168.1.2,dst=172.16.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=172.16.1.2,dst=172.16.1.100,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.2,dst=172.16.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -390,15 +390,15 @@ ovn-nbctl lr-lb-add R2 lb1-no-aff
>  ovn-nbctl lr-lb-add R2 lb11-no-aff
>
>  # check we use both backends
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([alice1], [nc -z 172.16.1.101 8080])
> -    ovs-ofctl del-flows br-int table=78
> -done
> -
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.1.101) |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([alice1], [nc -z 172.16.1.101 8080])
> +        ovs-ofctl del-flows br-int table=78
> +    done
> +
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.1.101) | \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=172.16.1.2,dst=172.16.1.101,sport=<cleared>,dport=<cleared>),reply=(src=192.168.1.2,dst=172.16.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=172.16.1.2,dst=172.16.1.101,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.2,dst=172.16.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -447,15 +447,15 @@ ovn-nbctl ls-lb-add foo lb30-no-aff
>  # Flush conntrack entries for easier output parsing of next test.
>  AT_CHECK([ovs-appctl dpctl/flush-conntrack])
>
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([foo1], [nc -z 192.168.2.101 8080])
> -    ovs-ofctl del-flows br-int table=78
> -done
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([foo1], [nc -z 192.168.2.101 8080])
> +        ovs-ofctl del-flows br-int table=78
> +    done
>
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(192.168.2.101) |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(192.168.2.101) | \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=192.168.1.2,dst=192.168.2.101,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.2,dst=192.168.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=192.168.1.2,dst=192.168.2.101,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.3,dst=192.168.1.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -631,14 +631,14 @@ NETNS_DAEMONIZE([foo1], [nc -l -k fd11::2 80],
> [nc-foo1.pid])
>  NETNS_DAEMONIZE([bar1], [nc -l -k fd12::2 80], [nc-bar1.pid])
>
>  dnl Should work with the virtual IP address through NAT
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([alice1], [nc -z fd30::1 8080])
> -done
> -
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd30::1) | grep -v
> fe80 |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([alice1], [nc -z fd30::1 8080])
> +    done
> +
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd30::1) | grep -v fe80 |
> \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=fd72::2,dst=fd30::1,sport=<cleared>,dport=<cleared>),reply=(src=fd11::2,dst=fd72::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=fd72::2,dst=fd30::1,sport=<cleared>,dport=<cleared>),reply=(src=fd12::2,dst=fd72::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -690,15 +690,15 @@ ovn-nbctl lr-lb-add R2 lb1-no-aff
>  ovn-nbctl lr-lb-add R2 lb11-no-aff
>
>  # check we use both backends
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([alice1], [nc -z fd30::2 8080])
> -    ovs-ofctl del-flows br-int table=78
> -done
> -
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd30::2) | grep -v
> fe80 |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([alice1], [nc -z fd30::2 8080])
> +        ovs-ofctl del-flows br-int table=78
> +    done
> +
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd30::2) | grep -v fe80 |
> \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=fd72::2,dst=fd30::2,sport=<cleared>,dport=<cleared>),reply=(src=fd11::2,dst=fd72::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=fd72::2,dst=fd30::2,sport=<cleared>,dport=<cleared>),reply=(src=fd12::2,dst=fd72::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -745,14 +745,14 @@ ovn-nbctl ls-lb-add foo lb30
>  ovn-nbctl ls-lb-add foo lb3-no-aff
>  ovn-nbctl ls-lb-add foo lb30-no-aff
>
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([foo1], [nc -z fd12::b 8080])
> -    ovs-ofctl del-flows br-int table=78
> -done
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([foo1], [nc -z fd12::b 8080])
> +        ovs-ofctl del-flows br-int table=78
> +    done
>
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd12::b) | grep -v
> fe80 |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd12::b) | grep -v fe80 |
> \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=fd11::2,dst=fd12::b,sport=<cleared>,dport=<cleared>),reply=(src=fd12::2,dst=fd11::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=fd11::2,dst=fd12::b,sport=<cleared>,dport=<cleared>),reply=(src=fd12::3,dst=fd11::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>  ])
> @@ -777,14 +777,14 @@ ovn-nbctl lr-lb-add R1 lb40-no-aff
>  # Flush conntrack entries for easier output parsing of next test.
>  AT_CHECK([ovs-appctl dpctl/flush-conntrack])
>
> -for i in $(seq 1 15); do
> -    echo Request $i
> -    NS_CHECK_EXEC([foo1], [nc -z fd11::a 8080])
> -done
> +OVS_WAIT_FOR_OUTPUT([
> +    for i in $(seq 1 5); do
> +        NS_EXEC([foo1], [nc -z fd11::a 8080])
> +    done
>
> -dnl Each server should have at least one connection.
> -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd11::2) | grep -v
> fe80 |
> -sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
> +    dnl Each server should have at least one connection.
> +    ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd11::2) | grep -v fe80 |
> \
> +      sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
>
>  
> tcp,orig=(src=fd11::2,dst=fd11::2,sport=<cleared>,dport=<cleared>),reply=(src=fd11::2,dst=fd11::b,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=fd11::2,dst=fd11::a,sport=<cleared>,dport=<cleared>),reply=(src=fd11::2,dst=fd11::2,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
>
>  
> tcp,orig=(src=fd11::b,dst=fd11::2,sport=<cleared>,dport=<cleared>),reply=(src=fd11::2,dst=fd11::b,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
> --
> 2.31.1
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Looks good to me, thanks.

Acked-by: Ales Musil <[email protected]>

-- 

Ales Musil

Senior Software Engineer - OVN Core

Red Hat EMEA <https://www.redhat.com>

[email protected]    IM: amusil
<https://red.ht/sig>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to