From patchwork Fri Jun 24 19:52:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Bryant X-Patchwork-Id: 640404 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 3rbpsC0vmvz9t0P for ; Sat, 25 Jun 2016 05:52:47 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6765510CE2; Fri, 24 Jun 2016 12:52:26 -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 66B1210CE2 for ; Fri, 24 Jun 2016 12:52:25 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id E8635420623 for ; Fri, 24 Jun 2016 13:52:24 -0600 (MDT) X-ASG-Debug-ID: 1466797944-09eadd24ba22eaf0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar5.cudamail.com with ESMTP id cRGFcVfG1Q1X8363 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 24 Jun 2016 13:52:24 -0600 (MDT) X-Barracuda-Envelope-From: russell@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 24 Jun 2016 19:52:24 -0000 Received-SPF: neutral (mx3-pf3.cudamail.com: 209.132.183.28 is neither permitted nor denied by SPF record at ovn.org) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 680B090E45; Fri, 24 Jun 2016 19:52:23 +0000 (UTC) Received: from x1c.redhat.com (ovpn-112-42.phx2.redhat.com [10.3.112.42]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5OJqErw009539; Fri, 24 Jun 2016 15:52:21 -0400 X-CudaMail-Envelope-Sender: russell@ovn.org From: Russell Bryant To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-623039580 X-CudaMail-DTE: 062416 X-CudaMail-Originating-IP: 209.132.183.28 Date: Fri, 24 Jun 2016 15:52:11 -0400 X-ASG-Orig-Subj: [##CM-V3-623039580##][PATCH 4/4] ovn: Test that port state goes up and down. Message-Id: <1466797931-23871-5-git-send-email-russell@ovn.org> In-Reply-To: <1466797931-23871-1-git-send-email-russell@ovn.org> References: <1466797931-23871-1-git-send-email-russell@ovn.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 24 Jun 2016 19:52:23 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1466797944 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 4/4] ovn: Test that port state goes up and down. 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" Some previous commits broke ovn-controller binding handling such that ovn-controller never cleared out the chassis column of the Port_Binding table. This broke OpenStack CI for OVN. This patch adds an OVN test case that would have caught this issue. Signed-off-by: Russell Bryant Acked-by: Ryan Moats --- tests/ovn.at | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/ovn.at b/tests/ovn.at index 297070c..5aa1fd6 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -3182,3 +3182,49 @@ OVS_APP_EXIT_AND_WAIT([ovs-vswitchd]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP + +# 1 hypervisor, 1 port +# make sure that the port state is properly set to up and back down +# when created and deleted. +AT_SETUP([ovn -- port state up and down]) +AT_KEYWORDS([ovn]) +ovn_start + +ovn-nbctl ls-add ls1 +ovn-nbctl lsp-add ls1 lp1 +ovn-nbctl lsp-set-addresses lp1 unknown + +net_add n1 +sim_add hv1 +echo 1 +as hv1 ovs-vsctl add-br br-phys +echo 2 +as hv1 ovn_attach n1 br-phys 192.168.0.1 +echo 3 + +as hv1 ovs-vsctl add-port br-int vif1 -- set Interface vif1 external-ids:iface-id=lp1 +OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lp1` = xup]) +echo 4 + +as hv1 ovs-vsctl del-port br-int vif1 +OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lp1` = xdown]) + +echo 5 +as hv1 +OVS_APP_EXIT_AND_WAIT([ovn-controller]) +OVS_APP_EXIT_AND_WAIT([ovs-vswitchd]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +as ovn-sb +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +as ovn-nb +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +as northd +OVS_APP_EXIT_AND_WAIT([ovn-northd]) + +as main +OVS_APP_EXIT_AND_WAIT([ovs-vswitchd]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) +AT_CLEANUP