From patchwork Mon May 17 13:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Amber X-Patchwork-Id: 1479542 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.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FkLc61Mj1z9sXb for ; Tue, 18 May 2021 00:09:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 43595818A7; Mon, 17 May 2021 14:09:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WYCY3nhYGq1A; Mon, 17 May 2021 14:09:36 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTP id D8CE083CF8; Mon, 17 May 2021 14:09:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 83876C0028; Mon, 17 May 2021 14:09:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1AEEAC0022 for ; Mon, 17 May 2021 14:09:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 46EDC404ED for ; Mon, 17 May 2021 14:08:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RydYPwcOZgJg for ; Mon, 17 May 2021 14:08:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by smtp2.osuosl.org (Postfix) with ESMTPS id 89E0C404E9 for ; Mon, 17 May 2021 14:08:25 +0000 (UTC) IronPort-SDR: PQnJR9GPacskS6E325Jn6O+DfNNtu8S3bOxb3gFkxOtDT2BeZGcjvLjXtYTS5oOL4vPEEwIZxP oC1Sg4oBaULg== X-IronPort-AV: E=McAfee;i="6200,9189,9986"; a="221510488" X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="221510488" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 07:08:25 -0700 IronPort-SDR: dj1rMkLCvw1anTZFdhHMNXpqE9HAW5eMPnKOFVu3Z9I1G3clhb18ttRbVUMg2dzk639+BzjTPw tMjsrD772z1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="438936730" Received: from bmca4bf01706bbf.iind.intel.com (HELO localhost.localdomain) ([10.190.213.111]) by orsmga008.jf.intel.com with ESMTP; 17 May 2021 07:08:23 -0700 From: Kumar Amber To: dev@openvswitch.org Date: Mon, 17 May 2021 19:27:03 +0530 Message-Id: <20210517135708.685517-8-kumar.amber@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517135708.685517-1-kumar.amber@intel.com> References: <20210428091931.2090062-1-kumar.amber@intel.com> <20210517135708.685517-1-kumar.amber@intel.com> MIME-Version: 1.0 Cc: Kumar Amber , i.maximets@ovn.org Subject: [ovs-dev] [v3 07/12] test/sytem-dpdk: Add unit test for mfex autovalidator 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Tests: 6: OVS-DPDK - MFEX Autovalidator 7: OVS-DPDK - MFEX Autovalidator Fuzzy Added a new directory to store the PCAP file used in the tests and a script to generate the fuzzy traffic type pcap to be used in fuzzy unit test. Signed-off-by: Kumar Amber --- tests/automake.mk | 5 +++++ tests/pcap/fuzzy.py | 16 +++++++++++++++ tests/pcap/mfex_test | Bin 0 -> 416 bytes tests/system-dpdk.at | 46 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100755 tests/pcap/fuzzy.py create mode 100644 tests/pcap/mfex_test diff --git a/tests/automake.mk b/tests/automake.mk index 1a528aa39..532875971 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -142,6 +142,11 @@ $(srcdir)/tests/fuzz-regression-list.at: tests/automake.mk echo "TEST_FUZZ_REGRESSION([$$basename])"; \ done > $@.tmp && mv $@.tmp $@ +EXTRA_DIST += $(MFEX_AUTOVALIDATOR_TESTS) +MFEX_AUTOVALIDATOR_TESTS = \ + tests/pcap/mfex_test \ + tests/pcap/fuzzy.py + OVSDB_CLUSTER_TESTSUITE_AT = \ tests/ovsdb-cluster-testsuite.at \ tests/ovsdb-execution.at \ diff --git a/tests/pcap/fuzzy.py b/tests/pcap/fuzzy.py new file mode 100755 index 000000000..abe2aeea0 --- /dev/null +++ b/tests/pcap/fuzzy.py @@ -0,0 +1,16 @@ +#!/usr/bin/python3 +try: + from scapy.all import * +except ModuleNotFoundError as err: + print(err + ": Scapy") +import sys +import os + +path = os.environ['OVS_DIR'] + "/tests/pcap/fuzzy" +pktdump = PcapWriter(path, append=False, sync=True) + +for i in range(0, 2000): + pktdump.write(fuzz(Ether()/IP()/UDP())) + pktdump.write(fuzz(Ether()/IP()/TCP())) + pktdump.write(fuzz(Ether()/Dot1Q()/IP()/UDP())) + pktdump.write(fuzz(Ether()/Dot1Q()/IP()/TCP())) diff --git a/tests/pcap/mfex_test b/tests/pcap/mfex_test new file mode 100644 index 0000000000000000000000000000000000000000..1aac67b8d643ecb016c758cba4cc32212a80f52a GIT binary patch literal 416 zcmca|c+)~A1{MYw`2U}Qff2}QK`M68ITRa|G@yFii5$Gfk6YL%z>@uY&}o| z2s4N<1VH2&7y^V87$)XGOtD~MV$cFgfG~zBGGJ2#YtF$KST_NTIwYriok6N4Vm)gX-Q@c^{cp<7_5LgK^UuU{2>VS0RZ!RQ+EIW literal 0 HcmV?d00001 diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index 802895488..46eaea35a 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -232,3 +232,49 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch kernel module is probably \@EAL: No free hugepages reported in hugepages-1048576kB@d"]) AT_CLEANUP dnl -------------------------------------------------------------------------- + +dnl -------------------------------------------------------------------------- +dnl Add standard DPDK PHY port +AT_SETUP([OVS-DPDK - MFEX Autovalidator]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_pcap1,rx_pcap=$OVS_DIR/tests/pcap/mfex_test,infinite_rx=1], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl show], [], [stdout]) + + +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl +Miniflow implementation set to autovalidator. +]) +sleep 5 + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr]) +AT_CLEANUP +dnl -------------------------------------------------------------------------- + +dnl -------------------------------------------------------------------------- +dnl Add standard DPDK PHY port +AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy]) +AT_KEYWORDS([dpdk]) +AT_CHECK([$PYTHON3 $OVS_DIR/tests/pcap/fuzzy.py], [], [stdout]) +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_pcap1,rx_pcap=$OVS_DIR/tests/pcap/fuzzy,infinite_rx=1], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl show], [], [stdout]) + + +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl +Miniflow implementation set to autovalidator. +]) +sleep 20 + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr]) +AT_CLEANUP +dnl --------------------------------------------------------------------------