From patchwork Thu Apr 20 16:23:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1771535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L9UDbJ5W; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q2NHj6zVkz1ybF for ; Fri, 21 Apr 2023 02:23:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A3FC24089B; Thu, 20 Apr 2023 16:23:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A3FC24089B Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L9UDbJ5W X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bE8eM3jq5vRN; Thu, 20 Apr 2023 16:23:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0C6E34002B; Thu, 20 Apr 2023 16:23:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0C6E34002B Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D2F53C0037; Thu, 20 Apr 2023 16:23:06 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A0199C002A for ; Thu, 20 Apr 2023 16:23:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 67B6B40463 for ; Thu, 20 Apr 2023 16:23:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 67B6B40463 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L9UDbJ5W X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 93sivFtchMEH for ; Thu, 20 Apr 2023 16:23:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3794B400D8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3794B400D8 for ; Thu, 20 Apr 2023 16:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682007782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dlui4/gblOqvXT7CnTdnpBEcF5E1FShIK9VN2qrxSiA=; b=L9UDbJ5W3wtI/GF/4nFWg5ZnHbWmPC+hEkdKvuiu0vpZfo5Wo7BwWrnJWBFp5jpUiw+QSo DqtSnsXtgsK85L/PPvC73CgdUd5YJ/207wq391eUW0c7U6bVeG6b9BJ+c8YCIk9oGBDVz2 dFh8MawPokZoiWPAAw+HNhJ3CaEV7zs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-FwvgRfU8Mu-S5axnqdeMVg-1; Thu, 20 Apr 2023 12:23:01 -0400 X-MC-Unique: FwvgRfU8Mu-S5axnqdeMVg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 135EB858289 for ; Thu, 20 Apr 2023 16:23:01 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDFE91410F1F; Thu, 20 Apr 2023 16:23:00 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Thu, 20 Apr 2023 18:23:00 +0200 Message-Id: <20230420162300.146780-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] tests: fix "load balancing affinity sessions - IPv4 and IPv6" X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 Acked-by: Ales Musil --- 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=/'], [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=/'], [0], [dnl tcp,orig=(src=172.16.1.2,dst=172.16.1.100,sport=,dport=),reply=(src=192.168.1.2,dst=172.16.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=172.16.1.2,dst=172.16.1.100,sport=,dport=),reply=(src=192.168.2.2,dst=172.16.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [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=/'], [0], [dnl tcp,orig=(src=172.16.1.2,dst=172.16.1.101,sport=,dport=),reply=(src=192.168.1.2,dst=172.16.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=172.16.1.2,dst=172.16.1.101,sport=,dport=),reply=(src=192.168.2.2,dst=172.16.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [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=/'], [0], [dnl tcp,orig=(src=192.168.1.2,dst=192.168.2.101,sport=,dport=),reply=(src=192.168.2.2,dst=192.168.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=192.168.1.2,dst=192.168.2.101,sport=,dport=),reply=(src=192.168.2.3,dst=192.168.1.2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [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=/'], [0], [dnl tcp,orig=(src=fd72::2,dst=fd30::1,sport=,dport=),reply=(src=fd11::2,dst=fd72::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=fd72::2,dst=fd30::1,sport=,dport=),reply=(src=fd12::2,dst=fd72::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [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=/'], [0], [dnl tcp,orig=(src=fd72::2,dst=fd30::2,sport=,dport=),reply=(src=fd11::2,dst=fd72::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=fd72::2,dst=fd30::2,sport=,dport=),reply=(src=fd12::2,dst=fd72::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [0], [dnl + ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd12::b) | grep -v fe80 | \ + sed -e 's/zone=[[0-9]]*/zone=/'], [0], [dnl tcp,orig=(src=fd11::2,dst=fd12::b,sport=,dport=),reply=(src=fd12::2,dst=fd11::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=fd11::2,dst=fd12::b,sport=,dport=),reply=(src=fd12::3,dst=fd11::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) ]) @@ -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=/'], [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=/'], [0], [dnl tcp,orig=(src=fd11::2,dst=fd11::2,sport=,dport=),reply=(src=fd11::2,dst=fd11::b,sport=,dport=),zone=,protoinfo=(state=) tcp,orig=(src=fd11::2,dst=fd11::a,sport=,dport=),reply=(src=fd11::2,dst=fd11::2,sport=,dport=),zone=,mark=2,protoinfo=(state=) tcp,orig=(src=fd11::b,dst=fd11::2,sport=,dport=),reply=(src=fd11::2,dst=fd11::b,sport=,dport=),zone=,protoinfo=(state=)