From patchwork Fri Sep 11 18:11:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Lenglet X-Patchwork-Id: 516925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id AAB5014010F for ; Sat, 12 Sep 2015 04:11:15 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E90B922C3B3; Fri, 11 Sep 2015 11:11:12 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 174EC10C5B for ; Fri, 11 Sep 2015 11:11:12 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 394991E02A8 for ; Fri, 11 Sep 2015 12:11:11 -0600 (MDT) X-ASG-Debug-ID: 1441995069-09eadd2a41100f0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id kGjbMy34CZxGLMOC (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Sep 2015 12:11:09 -0600 (MDT) X-Barracuda-Envelope-From: romain.lenglet@oracle.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO userp1040.oracle.com) (156.151.31.81) by mx1-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 11 Sep 2015 18:11:09 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at spf_s.oracle.com designates 156.151.31.81 as permitted sender) X-Barracuda-Apparent-Source-IP: 156.151.31.81 X-Barracuda-RBL-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t8BIB5aP018211 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Sep 2015 18:11:05 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t8BIB5FL007524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 11 Sep 2015 18:11:05 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t8BIB49Q022333; Fri, 11 Sep 2015 18:11:05 GMT Received: from rlenglet-mac (/10.159.254.90) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 11 Sep 2015 11:11:04 -0700 Date: Fri, 11 Sep 2015 11:11:04 -0700 X-CudaMail-Envelope-Sender: romain.lenglet@oracle.com From: Romain Lenglet To: dev@openvswitch.org, Joe Stringer Message-ID: In-Reply-To: <1441935692-6848-2-git-send-email-joestringer@nicira.com> References: <1441935692-6848-1-git-send-email-joestringer@nicira.com> <1441935692-6848-2-git-send-email-joestringer@nicira.com> X-CudaMail-MID: CM-E2-910057678 X-CudaMail-DTE: 091115 X-CudaMail-Originating-IP: 156.151.31.81 X-Mailer: Airmail (303) X-ASG-Orig-Subj: [##CM-E2-910057678##]Re: [PATCH 1/3] tests: Add basic IPFIX test. MIME-Version: 1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] X-GBUdb-Analysis: 0, 156.151.31.81, Ugly c=0.394543 p=-0.173913 Source Normal X-MessageSniffer-Rules: 0-0-0-13432-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1441995069 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 per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, HTML_MESSAGE, RDNS_NONE, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22448 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.00 HTML_MESSAGE BODY: HTML included in message 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Subject: Re: [ovs-dev] [PATCH 1/3] tests: Add basic IPFIX test. 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" Thanks for doing this! Acked-by: Romain Lenglet --  Romain Lenglet On September 10, 2015 at 6:41:41 PM, Joe Stringer (joestringer@nicira.com) wrote: Previously, we had no IPFIX tests in the testsuite. Now we have one. Signed-off-by: Joe Stringer --- tests/ofproto-dpif.at | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) -- 2.1.4 diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index eb8647b..93ce5df 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -5512,6 +5512,43 @@ AT_SKIP_IF([test $HAVE_IPV6 = no]) CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]]) AT_CLEANUP +dnl In the absence of an IPFIX collector to verify protocol correctness, simply +dnl configure IPFIX and ensure that sample action generation works at the +dnl datapath level. +AT_SETUP([ofproto-dpif - Basic IPFIX sanity check]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2) + +dnl Sample every packet using bridge-based sampling +AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \ + --id=@fix create ipfix targets=\"127.0.0.1:4739\" \ + sampling=1], [0], [ignore]) + +dnl Send some packets that should be sampled +for i in `seq 1 3`; do + AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)']) +done +AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl +flow-dump from non-dpdk interfaces: +packets:2, bytes:120, used:0.001s, actions:sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=4294967295)))) +]) + +dnl Remove the IPFIX configuration +AT_CHECK([ovs-vsctl clear bridge br0 ipfix]) +AT_CHECK([ovs-appctl revalidator/purge]) + +dnl Send some more packets, to ensure that these are not sampled. +for i in `seq 1 3`; do + AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)']) +done +AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl +flow-dump from non-dpdk interfaces: +packets:2, bytes:120, used:0.001s, actions:drop +]) + +OVS_VSWITCHD_STOP(["/sending to collector failed/d"]) +AT_CLEANUP + AT_SETUP([ofproto-dpif - flow stats]) OVS_VSWITCHD_START AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])