From patchwork Tue Aug 30 23:58:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramu Ramamurthy X-Patchwork-Id: 664328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3sP57r4pcSz9s9G for ; Wed, 31 Aug 2016 09:58:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=FgSOvi6f; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 8008B10873; Tue, 30 Aug 2016 16:58:31 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 838B51086B for ; Tue, 30 Aug 2016 16:58:29 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id EC369420259 for ; Tue, 30 Aug 2016 17:58:28 -0600 (MDT) X-ASG-Debug-ID: 1472601506-09eadd1684b18f0001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar5.cudamail.com with ESMTP id pp6ZwcAQptMofaKw (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 30 Aug 2016 17:58:27 -0600 (MDT) X-Barracuda-Envelope-From: ramu.ramamurthy@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-it0-f66.google.com) (209.85.214.66) by mx3-pf1.cudamail.com with ESMTPS (AES128-SHA encrypted); 30 Aug 2016 23:58:26 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.214.66 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.214.66 X-Barracuda-RBL-IP: 209.85.214.66 Received: by mail-it0-f66.google.com with SMTP id n75so3841312ith.0 for ; Tue, 30 Aug 2016 16:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gHexKe1v9YSA+e1PIbgndbkY0vr+xdDw/G5HjhyDo70=; b=FgSOvi6farvS3t4FPWVhmp+7zaA+en99cfymwUMmWnfuXEn8xuU5bgdr/jg3DFInUw /kuH28Kzbpd6QsaI1NnzvS7tgv1v2Dyrke3DkKXceCTCl/aW7lhTzlw1O1HQvpCzUEGa xbztbvBMzn1UnMyWNZKjs7JH27+ICxiGM3VtSGAsRaYM82Wau8+ABZOVZLML0LrA1A2K b6XcAHROFwUf2fDbX1EcXguYVis8y+fpSGMccFwbOgyov/9k96NQ7P+cBST5AZiinEy1 RHEJ5lZilLy7F+cQqKuFno9W7s3Lh31LZXx5AZEDaTDK+8Zy+ppAFvys/PUb4T9FYx9z OU+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gHexKe1v9YSA+e1PIbgndbkY0vr+xdDw/G5HjhyDo70=; b=GmbqyuSyyAlcGs6YLILslAXCroKLp+fX5xIis7AZEoNrOYrOdm8qQYvuf0idiEVyJj aKR0c0pgAo/2+jR5BnakMl8DkvH9mQGlkVjSW/rdvabqpWrh8L7NwHmtQlWxyE0mcUlO Y7NDIOpaBkIlsJRoiXha7T4fk/54nIul9qXbDysM45S2SX36SPLLfTZubGLrN0GtwVwm xtSGlbu/NqrvuOn3Kjr6GPDErbjDEuxTc4f9Cm65eEFimZaXKrfPcmF6sKpe4xhzXGpp l6DRiOcLofvS4qVLXEnp0Du48Djxn4mjm9EPPD+Gdc5ngw9Y8eUtc9zItyFK0IGPZfz/ q5bA== X-Gm-Message-State: AE9vXwOr6lZTA0gdwUyYN7e+xTiwwRKzxYOUcIvcXAcbc5LPMWIWVa4d4gbxQuy4sC1B2g== X-Received: by 10.36.138.68 with SMTP id v65mr20773854itd.0.1472601505150; Tue, 30 Aug 2016 16:58:25 -0700 (PDT) Received: from compute-02.node.os ([32.97.110.51]) by smtp.gmail.com with ESMTPSA id w184sm684029iow.35.2016.08.30.16.58.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 16:58:24 -0700 (PDT) X-CudaMail-Envelope-Sender: ramu.ramamurthy@gmail.com From: Ramu Ramamurthy To: dev@openvswitch.org X-CudaMail-MID: CM-V1-829059385 X-CudaMail-DTE: 083016 X-CudaMail-Originating-IP: 209.85.214.66 Date: Tue, 30 Aug 2016 23:58:34 +0000 X-ASG-Orig-Subj: [##CM-V1-829059385##][PATCH] ovn: add lsp-deletion and bcast-flow removal tests for localnet Message-Id: <1472601514-23150-1-git-send-email-ramu.ramamurthy@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-GBUdb-Analysis: 0, 209.85.214.66, Ugly c=0.323114 p=-0.130435 Source Normal X-MessageSniffer-Rules: 0-0-0-10812-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1472601507 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Ramu Ramamurthy Subject: [ovs-dev] [PATCH] ovn: add lsp-deletion and bcast-flow removal tests for localnet X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" From: Ramu Ramamurthy Add 2 tests for scenarios around lsp-deletion and flow removal which have escaped current unit tests. This test depends on the following patch: "ovn-controller: Back out incremental processing" and passes after applying it, but fails currently on master. 1) In the following sequence of events, createi&bind vif1, create&bind vif2, delete vif1 we find that the localnet patch port got deleted, whereas it should exist because there is a bound vif2. 2) The flow broadcasting to tunnels in table=32 must be deleted when a localnet port gets bound, but we find that the flow remains in table 32 causing broadcasts to both tunnels and localnet patch. Signed-off-by: Ramu Ramamurthy --- tests/ovn.at | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tests/ovn.at b/tests/ovn.at index a23b422..3fa267a 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -5053,3 +5053,74 @@ OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=0 | grep REG13 | wc -l` OVN_CLEANUP([hv1]) AT_CLEANUP + + +AT_SETUP([ovn -- lsp deletion and broadcast-flow deletion on localnet]) +AT_KEYWORDS([ovn]) +ovn_start +ovn-nbctl ls-add lsw0 +net_add n1 +for i in 1 2; do + sim_add hv$i + as hv$i + ovs-vsctl add-br br-phys + ovn_attach n1 br-phys 192.168.0.$i + ovs-vsctl add-br br-eth0 + AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=physnet1:br-eth0]) +done + +# Create a localnet port. +AT_CHECK([ovn-nbctl lsp-add lsw0 ln_port]) +AT_CHECK([ovn-nbctl lsp-set-addresses ln_port unknown]) +AT_CHECK([ovn-nbctl lsp-set-type ln_port localnet]) +AT_CHECK([ovn-nbctl lsp-set-options ln_port network_name=physnet1]) + + +# Create 3 vifs. +AT_CHECK([ovn-nbctl lsp-add lsw0 localvif1]) +AT_CHECK([ovn-nbctl lsp-set-addresses localvif1 "f0:00:00:00:00:01 192.168.1.1"]) +AT_CHECK([ovn-nbctl lsp-set-port-security localvif1 "f0:00:00:00:00:01"]) +AT_CHECK([ovn-nbctl lsp-add lsw0 localvif2]) +AT_CHECK([ovn-nbctl lsp-set-addresses localvif2 "f0:00:00:00:00:01 192.168.1.2"]) +AT_CHECK([ovn-nbctl lsp-set-port-security localvif2 "f0:00:00:00:00:02"]) +AT_CHECK([ovn-nbctl lsp-add lsw0 localvif3]) +AT_CHECK([ovn-nbctl lsp-set-addresses localvif3 "f0:00:00:00:00:03 192.168.1.3"]) +AT_CHECK([ovn-nbctl lsp-set-port-security localvif3 "f0:00:00:00:00:03"]) + +# Bind the localvif1 to hv1. +as hv1 +AT_CHECK([ovs-vsctl add-port br-int localvif1 -- set Interface localvif1 external_ids:iface-id=localvif1]) + +# On hv1, check that there are no flows outputting bcast to tunnel +OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 0]) + +# On hv2, check that there is 1 flow outputting bcast to tunnel to hv1. +as hv2 +OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 1]) + +# Now bind vif2 on hv2. +AT_CHECK([ovs-vsctl add-port br-int localvif2 -- set Interface localvif2 external_ids:iface-id=localvif2]) + +# At this point, the broadcast flow on vif2 should be deleted. +# because, there is now a localnet vif bound (table=32 programming logic) +OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 0]) + +# Verify that the local net patch port exists on hv2. +OVS_WAIT_UNTIL([test `ovs-vsctl show | grep "Port patch-br-int-to-ln_port" | wc -l` -eq 1]) + +# Now bind vif3 on hv2. +AT_CHECK([ovs-vsctl add-port br-int localvif3 -- set Interface localvif3 external_ids:iface-id=localvif3]) + +# Verify that the local net patch port still exists on hv2 +OVS_WAIT_UNTIL([test `ovs-vsctl show | grep "Port patch-br-int-to-ln_port" | wc -l` -eq 1]) + +# Delete localvif2 +AT_CHECK([ovn-nbctl lsp-del localvif2]) + +# Verify that the local net patch port still exists on hv2, +# because, localvif3 is still bound. +OVS_WAIT_UNTIL([test `ovs-vsctl show | grep "Port patch-br-int-to-ln_port" | wc -l` -eq 1]) + + +OVN_CLEANUP([hv1],[hv2]) +AT_CLEANUP