From patchwork Wed Aug 4 06:26:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1513181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: 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=D48HmwAA; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GfhbQ0hzXz9sWX for ; Wed, 4 Aug 2021 16:26:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CC37783C18; Wed, 4 Aug 2021 06:26:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ws8clzNh9VSC; Wed, 4 Aug 2021 06:26:36 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3324F83C0D; Wed, 4 Aug 2021 06:26:35 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0DC1AC0010; Wed, 4 Aug 2021 06:26:35 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 26890C000E for ; Wed, 4 Aug 2021 06:26:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 20C51405EF for ; Wed, 4 Aug 2021 06:26:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 dCydsKxo5WQT for ; Wed, 4 Aug 2021 06:26:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id D4225405B2 for ; Wed, 4 Aug 2021 06:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628058391; 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=/rkPZhP4dejbEXg/EmLA/dD/R4sqIho5QjFLdyBH2jI=; b=D48HmwAAHAzqqRzRfIkFYFMIIWOCVNmyhStz9hTJ/myScH51FX1OX4VsGQtUudzXUfIPgf SCSBEY1ZyZkr0vyYygtBgiRPSJRhBTtHcuJHmoSzdsgHPFqhB7XOycpQtiAxefUbiiW4PY dQsbkE2fo5uADOQUGe3XgGc5CYSIu6k= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-QkPwA1R2PUuIfLtoTRzQQg-1; Wed, 04 Aug 2021 02:26:26 -0400 X-MC-Unique: QkPwA1R2PUuIfLtoTRzQQg-1 Received: by mail-ed1-f69.google.com with SMTP id s10-20020a05640217cab02903bddc3e8fb3so784163edy.0 for ; Tue, 03 Aug 2021 23:26:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=/rkPZhP4dejbEXg/EmLA/dD/R4sqIho5QjFLdyBH2jI=; b=Co6A4jRwacajDkjpbJUzDRdXMDQQoaLOh6F+nKXTHztoxW20Y3P5Sxq9rvg0QrrTSN 8QvT1dzkkkIth9cv3yWKA3Cu/ydpVU2K4woANp5YFC+zYKcTDgFZ+/tgPsmzsAO4CptV NlmEUG3dGsAjl1EcOjeMqnbDJkEIGuHAzcOzzhsCFkG4ePfsgCNFXX3XaIm8+xepp4lj IGUNrznKLcWd7oZ2dGHKRY0KgAMYsaeO6Pi4cSfaGinJ9zxrpEAW/epTE0hot7Z5fY0S Y6WpK/rYQhKzIJO5Um1WtSpCiFk/e9gklXQ7yAeX9Y04HMMDsLtrje6wtiDD9IXZDdMz QbfQ== X-Gm-Message-State: AOAM533OYNT6P6IdBHugqTC445IqViRLYSnK1KKCTAeO5pTr14S+DhTd BSVWqMPp6KBUe6qW8o3k6/ucym7Fc+OVHV7lHcxc4sOsLv0c+W/10uF3Ay2BZ6wJO66kLijWmum 1CSQo6VfjBejXW/42bvp3NYi5R1SC/pp0ibgPyDf/l9XoTJ1554qLo+H2RlPyt6Cr X-Received: by 2002:a17:906:2813:: with SMTP id r19mr24065826ejc.150.1628058385406; Tue, 03 Aug 2021 23:26:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAfoNpG7eRHpXGNr5QtoWUBQcCfkjFNaZv/VyAVEpiLpZ/+e0Uviv4jgRV8fZGv1G+/fJ0Vg== X-Received: by 2002:a17:906:2813:: with SMTP id r19mr24065817ejc.150.1628058385254; Tue, 03 Aug 2021 23:26:25 -0700 (PDT) Received: from ?IPv6:2a02:a03f:6262:2900:23f6:c57c:50f1:4bb6? ([2a02:a03f:6262:2900:23f6:c57c:50f1:4bb6]) by smtp.gmail.com with ESMTPSA id s8sm520612edy.18.2021.08.03.23.26.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 23:26:24 -0700 (PDT) Message-ID: <9ec9642c0db469f04d6b52b28debe5b16f23753a.camel@redhat.com> From: Xavier Simonart To: "dev@openvswitch.org" Date: Wed, 04 Aug 2021 08:26:24 +0200 User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=xsimonar@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 1/2] system-ovn.at: Fix flaky "load-balancing" test. 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" When running load-balancing test, tcpdump is executed in background. When the backround tcpdump stops, it sends to stderr a message (such as number of packets captured) which might be catched by the following command (wget) causing the test to fail. Fixes: ebbcd8e8cc ("northd: add reject action for lb with no backends") Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1989517 Signed-off-by: Xavier Simonart --- v1 -> v2 * Address the fact that tcpdump sends to stderr --- tests/system-ovn.at | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.1 diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 4288d80e5..2d21fb262 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -1593,7 +1593,7 @@ OVS_WAIT_UNTIL([ ovn-nbctl --reject lb-add lb3 30.0.0.10:80 "" ovn-nbctl ls-lb-add foo lb3 # Filter reset segments -NS_CHECK_EXEC([foo1], [tcpdump -c 1 -neei foo1 ip[[33:1]]=0x14 > rst.pcap &]) +NS_CHECK_EXEC([foo1], [tcpdump -c 1 -neei foo1 ip[[33:1]]=0x14 > rst.pcap 2>/dev/null &]) sleep 1 NS_CHECK_EXEC([foo1], [wget -q 30.0.0.10],[4]) From patchwork Wed Aug 4 06:28:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1513182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: 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=BkU0fM7D; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gfhdf17hbz9sW5 for ; Wed, 4 Aug 2021 16:28:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1A66083C12; Wed, 4 Aug 2021 06:28:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5YiAhEAONThX; Wed, 4 Aug 2021 06:28:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id EF28C8343E; Wed, 4 Aug 2021 06:28:29 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CF59FC0010; Wed, 4 Aug 2021 06:28:29 +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 497B9C000E for ; Wed, 4 Aug 2021 06:28:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 38E2E40134 for ; Wed, 4 Aug 2021 06:28:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 6AjiQQ0w67DA for ; Wed, 4 Aug 2021 06:28:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id A52C1400FD for ; Wed, 4 Aug 2021 06:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628058505; 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=vn3Hk4iiYMbB0RexIrFvGn79C3wPYthN1PgiXqVGrfM=; b=BkU0fM7DbYKVXgKdb1qd3g36YCnmXwpeHA6T4O5If5eE6ASKHDfy446yoMzQaIXpBaWcSD iswBZvyTSShwY0SjI92jfiklOTtj/YyLAGjQKPSMk8RXs5e+yncoyc0+utRYOU6WupJDaP n9i3YCybClpKA+WOfYTfArWbnf/m7cA= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-mb5Bxw1yN--EnpFkj9Mmow-1; Wed, 04 Aug 2021 02:28:20 -0400 X-MC-Unique: mb5Bxw1yN--EnpFkj9Mmow-1 Received: by mail-ej1-f69.google.com with SMTP id gg1-20020a170906e281b029053d0856c4cdso461616ejb.15 for ; Tue, 03 Aug 2021 23:28:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=vn3Hk4iiYMbB0RexIrFvGn79C3wPYthN1PgiXqVGrfM=; b=fFa4bgBQ83+F77Es4aiAocfX2zmYoeudMoxdhI21vLtNgVFGMoh4C6UyudCDq1CIIq azXbFcjAOmqmm2t0bYafgx+mgnI2rrMvOHVW4aAH0AOivNtmoCxMApS1mP7XAYxqiYqz e1VWQ72NiI5WIw9fQhx1CKVVb2G+vB41y1SJsk0BnHqZa1AC0LGyRBCT6MkCLLcDiF9+ 5xPRCGhzPkhgFFBS0yZX1NTMcFlCLPzQfnx9F3ItrwXrcLKTr8Z4sUs9AnYY5xwsymDY Nzw76VwRLz6gEdKndIuLWZwfPRp35fpD7tJZbXN1qPequwOMYKCN4aMFLbljuE5zbZl+ OF0w== X-Gm-Message-State: AOAM533PrOJCWgYOqobB4uo32Y644mvF5Nviz7ejhF48FWWgt09cWId3 /AB2XAivJ+3mlI0EO98cb1dRRLCA78GaKKbf9K8jXp5oef2T9EnUoOwSnXtk/29ouujCLQw+YCI tynk33NubSxTsjLXD3Cl+MY/YyLaov3cYapNbCymNhxLLlH3ZQGu8FLawUHK0yyVI X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr30223763edb.185.1628058499014; Tue, 03 Aug 2021 23:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMsH3axiiWnYNX4Fg57K6m2bwHhrEg9MWh0azjUb2kcGmDMEiC8c/tgtnFTX3NWIWPjPPZXw== X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr30223748edb.185.1628058498780; Tue, 03 Aug 2021 23:28:18 -0700 (PDT) Received: from ?IPv6:2a02:a03f:6262:2900:23f6:c57c:50f1:4bb6? ([2a02:a03f:6262:2900:23f6:c57c:50f1:4bb6]) by smtp.gmail.com with ESMTPSA id cr9sm528839edb.17.2021.08.03.23.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 23:28:18 -0700 (PDT) Message-ID: From: Xavier Simonart To: "dev@openvswitch.org" Date: Wed, 04 Aug 2021 08:28:17 +0200 User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=xsimonar@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 2/2] system-ovn.at: Fix flaky "load-balancing" test (all servers targetted). 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" This test sends requests to LB and checks that each server receives at least one request. However, even if 20 requests are sent to 3 servers, there was a possibility that one server did not get any request (0.3%). Signed-off-by: Xavier Simonart --- tests/system-ovn.at | 115 +++++++++++++++++++++++++++++--------------- 1 file changed, 75 insertions(+), 40 deletions(-) diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 2d21fb262..d38316eea 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -1449,45 +1449,72 @@ OVS_START_L7([bar2], [http]) OVS_START_L7([bar3], [http]) dnl Should work with the virtual IP 30.0.0.1 address through NAT -for i in `seq 1 20`; do - echo Request $i - NS_CHECK_EXEC([foo1], [wget 30.0.0.1 -t 5 -T 1 --retry-connrefused -v -o wget$i.log]) -done - dnl Each server should have at least one connection. -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.1) | \ -sed -e 's/zone=[[0-9]]*/zone=/'], [0], [dnl -tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) +dnl With 20 requests, one server might not receive any connection +dnl in 0.3% of cases, so run a few times. + +OVS_WAIT_UNTIL([ + for i in `seq 1 20`; do + echo Request $i; + ip netns exec foo1 wget 30.0.0.1 -t 5 -T 1 --retry-connrefused -v -o wget$i.log; + done + ct1=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.1) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct2=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.1) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct3=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.1) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + test $ct1 -gt 0 && echo "There are flows for 172.16.1.2" + test $ct2 -gt 0 && echo "There are flows for 172.16.1.3" + test $ct3 -gt 0 && echo "There are flows for 172.16.1.4" + test $ct1 -gt 0 && test $ct2 -gt 0 && test $ct3 -gt 0 ]) dnl Should work with the virtual IP 30.0.0.3 address through NAT -for i in `seq 1 20`; do - echo Request $i - NS_CHECK_EXEC([foo1], [wget 30.0.0.3 -t 5 -T 1 --retry-connrefused -v -o wget$i.log]) -done - dnl Each server should have at least one connection. -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.3) | \ -sed -e 's/zone=[[0-9]]*/zone=/'], [0], [dnl -tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) +OVS_WAIT_UNTIL([ + for i in `seq 1 20`; do + echo Request $i; + ip netns exec foo1 wget 30.0.0.3 -t 5 -T 1 --retry-connrefused -v -o wget$i.log; + done + ct1=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.3) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct2=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.3) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct3=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.3) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.3,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + test $ct1 -gt 0 && echo "There are flows for 172.16.1.2" + test $ct2 -gt 0 && echo "There are flows for 172.16.1.3" + test $ct3 -gt 0 && echo "There are flows for 172.16.1.4" + test $ct1 -gt 0 && test $ct2 -gt 0 && test $ct3 -gt 0 ]) dnl Test load-balancing that includes L4 ports in NAT. -for i in `seq 1 20`; do - echo Request $i - NS_CHECK_EXEC([foo1], [wget 30.0.0.2:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log]) -done - dnl Each server should have at least one connection. -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ -sed -e 's/zone=[[0-9]]*/zone=/'], [0], [dnl -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) +OVS_WAIT_UNTIL([ + for i in `seq 1 20`; do + echo Request $i; + ip netns exec foo1 wget 30.0.0.2:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log; + done + ct1=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct2=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct3=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + test $ct1 -gt 0 && echo "There are flows for 172.16.1.2" + test $ct2 -gt 0 && echo "There are flows for 172.16.1.3" + test $ct3 -gt 0 && echo "There are flows for 172.16.1.4" + test $ct1 -gt 0 && test $ct2 -gt 0 && test $ct3 -gt 0 ]) # Configure selection_fields. @@ -1500,17 +1527,25 @@ OVS_WAIT_UNTIL([ AT_CHECK([ovs-appctl dpctl/flush-conntrack]) dnl Test load-balancing that includes L4 ports in NAT. -for i in `seq 1 20`; do - echo Request $i - NS_CHECK_EXEC([foo1], [wget 30.0.0.2:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log]) -done - dnl Each server should have at least one connection. -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ -sed -e 's/zone=[[0-9]]*/zone=/'], [0], [dnl -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) -tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=) +OVS_WAIT_UNTIL([ + for i in `seq 1 20`; do + echo Request $i; + ip netns exec foo1 wget 30.0.0.2:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log; + done + ct1=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.2,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct2=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.3,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + ct3=$(ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2) | \ + sed -e 's/zone=[[0-9]]*/zone=/'| \ + grep "tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=,dport=),reply=(src=172.16.1.4,dst=192.168.1.2,sport=,dport=),zone=,labels=0x2,protoinfo=(state=)" -c) + test $ct1 -gt 0 && echo "There are flows for 172.16.1.2" + test $ct2 -gt 0 && echo "There are flows for 172.16.1.3" + test $ct3 -gt 0 && echo "There are flows for 172.16.1.4" + test $ct1 -gt 0 && test $ct2 -gt 0 && test $ct3 -gt 0 ]) AT_CHECK([ovs-appctl dpctl/flush-conntrack])