From patchwork Fri Sep 11 01:41:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 516524 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 AF3AC140180 for ; Fri, 11 Sep 2015 11:41:59 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 4CE6510C1F; Thu, 10 Sep 2015 18:41:47 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id A783910C08 for ; Thu, 10 Sep 2015 18:41:43 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id EAF8B6180C3 for ; Thu, 10 Sep 2015 19:41:41 -0600 (MDT) X-ASG-Debug-ID: 1441935700-03dd7b096e0c290001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id p9FbWlaS2ogHyqOc (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Sep 2015 19:41:40 -0600 (MDT) X-Barracuda-Envelope-From: joestringer@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pa0-f45.google.com) (209.85.220.45) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 11 Sep 2015 01:41:39 -0000 Received-SPF: unknown (mx3-pf3.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.45 Received: by padhk3 with SMTP id hk3so58907528pad.3 for ; Thu, 10 Sep 2015 18:41:39 -0700 (PDT) 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:in-reply-to :references; bh=rQFhW1PhpxZRfkVeanjAT+zQpzjurNaY/KExVTlu3no=; b=TXnWcdkPPEpV8YH8Ub+TThcPteCb/11ldToa1B4gBD/pQgRYAgwFjderYiTHqA8iyk 2605oOqcpRlwtGMv0KexVbbi9L+N3m2kGXdpr13e53mntS7aO3YUeus6tNCMm7lBEbHK g4V6rv4bWC3gI/skuxqnv0dcPbYrIkpEvEEqbW4CrJEuAZWRNLQPIyHVbJXATH9LtVRK GpkcvFzS2Zlt9HZb2kv9FDjx/jJKMN4IYwPjJ6HwdUYYwaiF5gWzugB8UZC6xdpGjhTR c5LXYvW4UX8Bb9UT38QroW+sJs57QTn4htBCm1kJhnJVXSTWAAb7pMArJFkWNrCFV/mq /YaA== X-Gm-Message-State: ALoCoQnsG0KNrJPv+eshhcWW65+F0n3jScD8qaUoERKCz1+XrBG1WkXV40JnKFGa1wpiaaBnPZ0R X-Received: by 10.66.193.230 with SMTP id hr6mr80387024pac.39.1441935699390; Thu, 10 Sep 2015 18:41:39 -0700 (PDT) Received: from localhost.localdomain ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id uh10sm14422889pab.41.2015.09.10.18.41.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 18:41:39 -0700 (PDT) X-CudaMail-Envelope-Sender: joestringer@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-909069037 X-CudaMail-DTE: 091015 X-CudaMail-Originating-IP: 209.85.220.45 Date: Thu, 10 Sep 2015 18:41:30 -0700 X-ASG-Orig-Subj: [##CM-V3-909069037##][PATCH 1/3] tests: Add basic IPFIX test. Message-Id: <1441935692-6848-2-git-send-email-joestringer@nicira.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441935692-6848-1-git-send-email-joestringer@nicira.com> References: <1441935692-6848-1-git-send-email-joestringer@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1441935700 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 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: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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(+) 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"])