From patchwork Mon Dec 7 20:31:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1441572 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.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dh7QN1HZbz9sRf for ; Thu, 18 Feb 2021 19:38:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A20A4872C3; Thu, 18 Feb 2021 08:38:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O8USoSrdcp32; Thu, 18 Feb 2021 08:38:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id A8E56872A6; Thu, 18 Feb 2021 08:38:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8C8FFC0010; Thu, 18 Feb 2021 08:38:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D406C0010 for ; Thu, 18 Feb 2021 08:38:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1CEFD86974 for ; Thu, 18 Feb 2021 08:38:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dPELopIRbEoJ for ; Thu, 18 Feb 2021 08:38:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ti0189a330-0925.bb.online.no (ti0189a330-0925.bb.online.no [88.88.218.161]) by whitealder.osuosl.org (Postfix) with ESMTP id AD11D86D6F for ; Thu, 18 Feb 2021 08:37:55 +0000 (UTC) X-Mailbox-Line: From 8d93850d671218fd3737e8bd1b05e71d872be382 Mon Sep 17 00:00:00 2001 Message-Id: <8d93850d671218fd3737e8bd1b05e71d872be382.1613635760.git.frode.nordahl@canonical.com> In-Reply-To: References: From: Dumitru Ceara To: dev@openvswitch.org Date: Mon, 7 Dec 2020 21:31:25 +0100 Subject: [ovs-dev] [PATCH ovn branch-20.06 15/15] tests: Fix test "ovn -- Superseding ACLs with conjunction". 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The test was checking the output of "ovs-ofctl dump-flows" without taking into account that some fields don't have predictable values, e.g., hard_age. Instead, use ofctl_strip_all(). Fixes: 986b3d5e4ad6 ("ofctrl.c: Add a predictable resolution for conflicting flow actions.") Reported-by: Numan Siddique Signed-off-by: Dumitru Ceara Signed-off-by: Numan Siddique (cherry picked from commit 6e3d69e6b5153e26c869a03ec7dd1aaa40488005) Signed-off-by: Frode Nordahl --- tests/ovn.at | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index b38f6c9bc..24f83f2c5 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -13435,16 +13435,16 @@ ovn-nbctl acl-add ls1 to-lport 3 'ip4.src==10.0.0.1' allow ovn-nbctl --wait=hv sync # Check OVS flows, the less restrictive flows should have been installed. -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | \ - grep "priority=1003" | awk '{print $7 " " $8}' | \ +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | ofctl_strip_all | \ + grep "priority=1003" | \ sed 's/conjunction([[^)]]*)/conjunction()/g' | sort], [0], [dnl -priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() + table=45, priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() ]) # Traffic 10.0.0.1, 10.0.0.2 -> 10.0.0.3, 10.0.0.4 should be allowed. @@ -13481,16 +13481,16 @@ ovn-nbctl acl-del ls1 to-lport 3 'ip4.src==10.0.0.1 || ip4.src==10.0.0.1' ovn-nbctl --wait=hv sync # Check OVS flows, the second less restrictive allow ACL should have been installed. -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | \ - grep "priority=1003" | awk '{print $7 " " $8}' | \ +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | ofctl_strip_all | \ + grep "priority=1003" | \ sed 's/conjunction([[^)]]*)/conjunction()/g' | sort], [0], [dnl -priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() + table=45, priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() ]) # Remove the less restrictive allow ACL. @@ -13498,16 +13498,16 @@ ovn-nbctl acl-del ls1 to-lport 3 'ip4.src==10.0.0.1' ovn-nbctl --wait=hv sync # Check OVS flows, the 10.0.0.1 conjunction should have been reinstalled. -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | \ - grep "priority=1003" | awk '{print $7 " " $8}' | \ +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | ofctl_strip_all | \ + grep "priority=1003" | \ sed 's/conjunction([[^)]]*)/conjunction()/g' | sort], [0], [dnl -priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() + table=45, priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() ]) # Traffic 10.0.0.1, 10.0.0.2 -> 10.0.0.3, 10.0.0.4 should be allowed. @@ -13537,16 +13537,16 @@ ovn-nbctl acl-add ls1 to-lport 3 'ip4.src==10.0.0.1' allow ovn-nbctl --wait=hv sync # Check OVS flows, the less restrictive flows should have been installed. -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | \ - grep "priority=1003" | awk '{print $7 " " $8}' | \ +AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=45 | ofctl_strip_all | \ + grep "priority=1003" | \ sed 's/conjunction([[^)]]*)/conjunction()/g' | sort], [0], [dnl -priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) -priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() -priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() + table=45, priority=1003,conj_id=2,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,conj_id=3,ip,metadata=0x1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.3 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_dst=10.0.0.4 actions=conjunction(),conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.1 actions=resubmit(,46) + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.2 actions=conjunction() + table=45, priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction() ]) OVN_CLEANUP([hv1])