From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC7CCA034C; Tue, 18 Aug 2020 07:11:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9997C1C023; Tue, 18 Aug 2020 07:11:24 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 8C78C2BAA for ; Tue, 18 Aug 2020 07:11:22 +0200 (CEST) IronPort-SDR: ohfVhEehOrHyrSflKf1OCPsgJaeRce5RHNd+yz701mCOVcKwtBHsVhoGDyv1sZ7XB/REfCg4+w IRzaxIOS33Ww== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="142470848" X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="142470848" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 22:11:21 -0700 IronPort-SDR: LwYteirP3aMPPZgTUlIUBDKQGMsHr4lJAXHSMT3XDyQ2tbPp55PEwFFbkB0D5s32Ix6zgYhcCk zIN/7QHZ8Xrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="496721657" Received: from orsmsx601-2.jf.intel.com (HELO ORSMSX601.amr.corp.intel.com) ([10.22.229.81]) by fmsmga006.fm.intel.com with ESMTP; 17 Aug 2020 22:11:21 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 17 Aug 2020 22:11:20 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 17 Aug 2020 22:11:20 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.44) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Aug 2020 22:11:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKd+tWGwEcyNO040VZPf/upahVeUCiaH9gnE1k7d7pETOCGzLa3b5suchbef9P/RHWL0v7OShH/K+4oVLxTMsYRaP3rCr2EdmiWLB4npVM2L2KILQbHJdRQpZZtbZV4hrpBBC/jMzQzeopG2V0jL0xUHzNELKGnYrHYUUkgNjBxYV8VUZp8/nZNGJRKJzohigI9pOJVDb82RZB1tS6YdoGxaEgkujKtHL8ciw6f1Z/LYaWHQeb/souxoNO6Xepy1ng3DfBbDjCdhAbifXou+5LeiGSkG0UxJ3bo8QC23gZLJr1la+zVlqlzwPQ4so8e5yrKM3BEgW55f0awWpC67zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zHKofD5Fgw9gNuCfgoFig/EB/T4JGbrawEjFAnCyxBQ=; b=i57LSG5ZRNJi7WliOi5KVqYraACsMqNaPppcymko/kmvGt0hdBQLdAlItM9gMl4qjFt9NmWFDjsSTCRce0W1GKiItCIwm1Cpy2lfS9PlQlAarE4AE06pyQwWeO2yDRwKBfOQFyYRmUQqCoJhW8UR+BLCL6YheIl70p+tEieGxRcoy5T+9uVA1Fam5N8f8IabjzcZ9T8V+K10smnh1OeYHQDw+eYVP2DjHvkhkIdxeI3obeDG5vD2HVCyYbUXxISURbCtCFNpBQLsoCwSZoKQKGwhXij+hHvAe0sNyaQhF57S2F1LtGC2poGoSoeFUReKBpx9ZZIvINXPgJNvkxg6IQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zHKofD5Fgw9gNuCfgoFig/EB/T4JGbrawEjFAnCyxBQ=; b=d7v4treraYfu2SQ311AS2gQ/RAzK5MhLElViJZjGTxmOFuYa9XJk1NspCjYFPmqIM9+8S+UCqXwOCTfNq8JrfmmBj+EdodBWrFuI7QKUs0MtQlHhkekuugAkg1axIwKkNosJU9Vf28oTnzNmNM0Vojv3k6Zng/6n6N+CdQwmoSw= Received: from BL0PR11MB3364.namprd11.prod.outlook.com (2603:10b6:208:69::21) by BL0PR11MB3473.namprd11.prod.outlook.com (2603:10b6:208:6e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.20; Tue, 18 Aug 2020 05:11:02 +0000 Received: from BL0PR11MB3364.namprd11.prod.outlook.com ([fe80::34a2:b1af:211:5a26]) by BL0PR11MB3364.namprd11.prod.outlook.com ([fe80::34a2:b1af:211:5a26%7]) with mapi id 15.20.3283.028; Tue, 18 Aug 2020 05:11:02 +0000 From: "Lin, Xueqin" To: "Sun, GuinanX" , "dts@dpdk.org" CC: "Sun, GuinanX" Thread-Topic: [dts] [PATCH v3 2/2] tests/TestSuite_cloud_filter_with_l4_port.py add test cases Thread-Index: AQHWdQ/T7YioV2AEmUmAb84c+9f+aKk9UV6A Date: Tue, 18 Aug 2020 05:11:02 +0000 Message-ID: References: <20200817055452.68792-1-guinanx.sun@intel.com> <20200818030736.72683-1-guinanx.sun@intel.com> <20200818030736.72683-2-guinanx.sun@intel.com> In-Reply-To: <20200818030736.72683-2-guinanx.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31ef4f77-3f79-4e19-98cc-08d843351a24 x-ms-traffictypediagnostic: BL0PR11MB3473: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:234; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TiumDvww6AsEhBx5vB2SyQWxpkw52jFxaHzvPawMx97dqTKAwsT7Aisc2hEEYnqNk2jkxQ3VPjk5kSxIXypR/Jh1G22RXngIb8ZU+K9MYC0q7TmkoHdFnqi+bXOBmlcrCAMLwP/0+Z7F2XvQ1CQCW+2njQZpRVFnQjt7rM4TEw3cADQbCUw1XnXKeXkhttlVrOlo/GizJSDST9fDGCL5vuHkEnlZwJVgfVyaQlh2KGiidBvelqkdOnnDVbC3i6+JoIbB3OwKDam+/5Irrj1EsL7ED/ZvF5eI7rkyyFLqcOMaZs7z6FWHchP0oO7XAYnK x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR11MB3364.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(136003)(39860400002)(19627235002)(53546011)(66446008)(26005)(107886003)(66556008)(66476007)(76116006)(6506007)(64756008)(83380400001)(66946007)(9686003)(71200400001)(86362001)(186003)(55016002)(316002)(8936002)(4326008)(52536014)(478600001)(7696005)(2906002)(33656002)(30864003)(110136005)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: qNxal3/fcxMyH+UEtybxPh+r2+Mi760FmT/va2W+FblsWzXRf7fgUIycyqFI+St5uqOjIq2qaX/B7cd/w1eabltIGfuaMGQROdWOyunATwlAeOKmj5tD4B8y7D2smtzG0/5Auct5/sc8Z55qA22OC2nu8ej6VVT6RFD3ndVv8RAWQA5dfYGlCnOb1FgWVqpxX0wf8GxYXofFOi05L35jhsn/TTrXnX8cefWenWG3WE9OnJqF2E2onFkylvybwZGQe1EkXTPP5PIV/24YBUO7hgfIWwVs1Lrkc7SZF0ihMbrf6tqlwB9RrvpdmLbiy8OLRsP4Hp7o8SAYZTt/QP4xgn9rUt8oHoCHHBU6UFA237vO9CZPt9vRKXdvMz+F1YifjG0svLkxcvll5OF/0wlVRe1o2Uk1804E09UdgjI/oVKPn81OS6ch7MCHj4F5vEPG9YgcAK75buKmdzuNgpcLvO3y3L4Cn93bkX0F+T+yNm5jm+hMvYPzBe7hoTyx1N2R3q8MzsUdwSfvl8pim/JW08y9JlXYW39eQPUuq44bj7ipmrOnnW8hGlgqYkuDOIbgQoqGCQfro+lnv78JqOURzRU5c487eQsDb8jvuizFS4EFHItET0X9ramWk3ASYHufkjJ8XJ1vUbHcwf4FK6Mb6w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR11MB3364.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31ef4f77-3f79-4e19-98cc-08d843351a24 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2020 05:11:02.1580 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aLACrge4a2o0aOCl5XNvOzIBym0og2UdXaRUe3Psl1SuWHtMoJsHJdJA8AzAACUbupgDMLPRidEXsTF7NxwOWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3473 X-OriginatorOrg: intel.com Subject: Re: [dts] [PATCH v3 2/2] tests/TestSuite_cloud_filter_with_l4_port.py add test cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Xueqin Lin > -----Original Message----- > From: dts On Behalf Of Guinan Sun > Sent: Tuesday, August 18, 2020 11:08 AM > To: dts@dpdk.org > Cc: Sun, GuinanX > Subject: [dts] [PATCH v3 2/2] tests/TestSuite_cloud_filter_with_l4_port.p= y add > test cases >=20 > add test cases for the new cloud filter. >=20 > Signed-off-by: Guinan Sun > --- > tests/TestSuite_cloud_filter_with_l4_port.py | 358 +++++++++++++++++++ > 1 file changed, 358 insertions(+) > create mode 100644 tests/TestSuite_cloud_filter_with_l4_port.py >=20 > diff --git a/tests/TestSuite_cloud_filter_with_l4_port.py > b/tests/TestSuite_cloud_filter_with_l4_port.py > new file mode 100644 > index 0000000..005983d > --- /dev/null > +++ b/tests/TestSuite_cloud_filter_with_l4_port.py > @@ -0,0 +1,358 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2020 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without # > +modification, are permitted provided that the following conditions # > +are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS # > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > FOR # > +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT # > +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, # > +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > # > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, # > +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON > ANY # > +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # > +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE > USE # > +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + > +""" > +DPDK Test suite. > + > +Test the support of generic flow API by Poll Mode Drivers. > + > +""" > + > +import utils > +import time > +import re > + > +from test_case import TestCase > +from pmd_output import PmdOutput > +from settings import DRIVERS > +from crb import Crb > +from dut import Dut > +import packet > +from exception import VerifyFailure > +import scapy.layers.inet > +from scapy.utils import rdpcap > + > +MAX_QUEUE =3D 16 > + > +class TestCloudFilterWithL4Port(TestCase): > + > + def set_up_all(self): > + """ > + Run at the start of each test suite. > + Generic filter Prerequistites > + """ > + # Based on h/w type, choose how many ports to use > + self.dut_ports =3D self.dut.get_ports(self.nic) > + # Verify that enough ports are available > + self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports") > + self.cores =3D "1S/8C/1T" > + self.pf_cores =3D "1S/8C/1T" > + self.pmdout =3D PmdOutput(self.dut) > + > + localPort =3D self.tester.get_local_port(self.dut_ports[0]) > + self.tester_itf =3D self.tester.get_interface(localPort) > + self.pf_interface =3D self.dut.ports_info[self.dut_ports[0]]['in= tf'] > + self.pf_mac =3D self.dut.get_mac_address(0) > + self.pf_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > + self.pkt_obj =3D packet.Packet() > + > + self.verify(self.nic in ["fortville_eagle", "fortville_spirit", = "carlsville", > + "fortville_spirit_single", "fortpark_TLV", > + "fortpark_BASE-T","fortville_25g"], "%s nic not > + support cloud filter" % self.nic) > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + self.dut.kill_all() > + > + self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D%d --txq= =3D%d -- > disable-rss" % (MAX_QUEUE, MAX_QUEUE), "-w %s --file-prefix=3Dtest1" % > self.pf_pci) > + self.dut.send_expect("set fwd rxonly", "testpmd> ", 120) > + self.dut.send_expect("set promisc all off", "testpmd> ", 120) > + self.dut.send_expect("set verbose 1", "testpmd> ", 120) > + self.dut.send_expect("start", "testpmd> ", 120) > + time.sleep(2) > + > + def destroy_env(self): > + """ > + This is to stop testpmd. > + """ > + self.dut.send_expect("quit", "# ") > + time.sleep(2) > + > + def compare_memory_rules(self, expectedRules): > + """ > + dump all flow rules that have been created in memory and compare= that > total rules number with the given expected number > + to see if they are equal, as to get your conclusion after you ha= ve deleted > any flow rule entry. > + """ > + outstring =3D self.dut.send_expect("flow list 0", "testpmd> ", 2= 0) > + result_scanner =3D r'\d*.*?\d*.*?\d*.*?=3D>*' > + scanner =3D re.compile(result_scanner, re.DOTALL) > + m =3D scanner.findall(outstring) > + print("All flow entries are: ") > + for i in range(len(m)): > + print(m[i]) > + print('Expected rules are: %d - actual are: %d' % (expectedRules= , len(m))) > + self.verify(expectedRules =3D=3D len(m), 'Total rules number > + mismatched') > + > + def verify_rulenum(self, rule_num): > + """ > + Verify all the rules created. > + """ > + # check if there are expected flow rules have been created > + self.compare_memory_rules(rule_num) > + # check if one rule destroyed with success > + self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ") > + self.compare_memory_rules(rule_num - 1) > + # check if all flow rules have been removed with success > + self.dut.send_expect("flow flush 0", "testpmd> ") > + self.compare_memory_rules(0) > + > + def sendpkt(self, pktstr, count=3D1): > + import sys > + py_version =3D sys.version > + if py_version.startswith('3.'): > + self.pkt_obj.pktgen.pkts.clear() > + else: > + del self.pkt_obj.pktgen.pkts[:] > + self.pkt_obj.append_pkt(pktstr) > + self.pkt_obj.send_pkt(self.tester, tx_port=3Dself.tester_itf, > + count=3Dcount) > + > + def sendpkt_check_result(self, src_port, dst_port, queue, match, pct= ype=3D""): > + match_info =3D "/queue %d: " % queue > + # source port > + if src_port !=3D "" and dst_port =3D=3D "": > + if pctype =3D=3D "ipv4-udp": > + self.sendpkt(pktstr=3D'Ether()/IP()/UDP(sport=3D%s)' % s= rc_port) > + elif pctype =3D=3D "ipv4-tcp": > + self.sendpkt(pktstr=3D'Ether()/IP()/TCP(sport=3D%s)' % s= rc_port) > + elif pctype =3D=3D "ipv4-sctp": > + self.sendpkt(pktstr=3D'Ether()/IP()/SCTP(sport=3D%s)' % = src_port) > + elif pctype =3D=3D "ipv6-udp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/UDP(sport=3D%s)' %= src_port) > + elif pctype =3D=3D "ipv6-tcp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/TCP(sport=3D%s)' %= src_port) > + elif pctype =3D=3D "ipv6-sctp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/SCTP(sport=3D%s)' = % src_port) > + elif src_port =3D=3D "" and dst_port !=3D "": > + if pctype =3D=3D "ipv4-udp": > + self.sendpkt(pktstr=3D'Ether()/IP()/UDP(dport=3D%s)' % d= st_port) > + elif pctype =3D=3D "ipv4-tcp": > + self.sendpkt(pktstr=3D'Ether()/IP()/TCP(dport=3D%s)' % d= st_port) > + elif pctype =3D=3D "ipv4-sctp": > + self.sendpkt(pktstr=3D'Ether()/IP()/SCTP(dport=3D%s)' % = dst_port) > + elif pctype =3D=3D "ipv6-udp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/UDP(dport=3D%s)' %= dst_port) > + elif pctype =3D=3D "ipv6-tcp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/TCP(dport=3D%s)' %= dst_port) > + elif pctype =3D=3D "ipv6-sctp": > + self.sendpkt(pktstr=3D'Ether()/IPv6()/SCTP(dport=3D%s)' = % dst_port) > + elif src_port !=3D "" and dst_port !=3D "": > + if pctype =3D=3D "ipv4-udp": > + self.sendpkt(pktstr=3D'Ether()/IP()/UDP(sport=3D%s, > + dport=3D%s)' % (src_port, dst_port)) > + > + out_pf =3D self.dut.get_session_output(timeout=3D2) > + print("out_pf is %s" % out_pf) > + > + if match =3D=3D 1: > + self.verify(match_info in out_pf, "the packet not match the = expect > queue %d." % queue) > + else: > + if match_info in out_pf: > + raise Exception("the packet should not match the queue > + %d." % queue) > + > + def cloudfilter_test( > + self, ip_type=3D'ipv4', l4_port_type=3D'udp', src_dst=3D'src= ', port_value=3D156, > queue_id=3D0): > + > + # validate > + self.dut.send_expect( > + "flow validate 0 ingress pattern eth / %s / %s %s is %d = / end actions > pf / queue index %d / end" > + % (ip_type, l4_port_type, src_dst, port_value, queue= _id), > + "validated") > + > + # create > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / %s / %s %s is %d / = end actions pf > / queue index %d / end" > + % (ip_type, l4_port_type, src_dst, port_value, queue= _id), > + "created") > + > + # list > + self.compare_memory_rules(1) > + > + if src_dst is 'src': > + self.sendpkt_check_result("%d"%port_value, "", queue_id,= 1, "%s- > %s"%(ip_type,l4_port_type)) > + self.sendpkt_check_result("%d"%(port_value-1), "", queue= _id, 0, > "%s-%s"%(ip_type,l4_port_type)) > + else: > + self.sendpkt_check_result("", "%d"%port_value, queue_id,= 1, "%s- > %s"%(ip_type,l4_port_type)) > + self.sendpkt_check_result("", "%d"%(port_value-1), > + queue_id, 0, "%s-%s"%(ip_type,l4_port_type)) > + > + # flush > + self.dut.send_expect("flow flush 0", "testpmd> ") > + > + if src_dst is 'src': > + self.sendpkt_check_result("%d"%(port_value-1), "", queue= _id, 0, > "%s-%s"%(ip_type,l4_port_type)) > + else: > + self.sendpkt_check_result("", "%d"%(port_value-1), > + queue_id, 0, "%s-%s"%(ip_type,l4_port_type)) > + > + self.compare_memory_rules(0) > + > + def test_ipv4_udp_sport_only(self): > + # ipv4-udp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'udp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv4_udp_dport_only(self): > + # ipv4-udp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'udp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv4_tcp_sport_only(self): > + # ipv4-tcp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'tcp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv4_tcp_dport_only(self): > + #ipv4-tcp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'tcp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv4_sctp_sport_only(self): > + # ipv4-sctp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'sctp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv4_sctp_dport_only(self): > + #ipv4-sctp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv4', l4_port_type=3D'sctp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_udp_sport_only(self): > + # ipv6-udp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'udp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_udp_dport_only(self): > + # ipv6-udp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'udp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_tcp_sport_only(self): > + # ipv6-tcp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'tcp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_tcp_dport_only(self): > + #ipv6-tcp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'tcp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_sctp_sport_only(self): > + # ipv6-sctp > + # only src port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'sctp', src_dst=3D'src', > + port_value=3D156, queue_id=3D1) > + > + def test_ipv6_sctp_dport_only(self): > + #ipv6-sctp > + # only dst port > + self.cloudfilter_test( > + ip_type=3D'ipv6', l4_port_type=3D'sctp', src_dst=3D'dst', > + port_value=3D156, queue_id=3D1) > + > + def test_multi_rule(self): > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / udp src is 11 / = end actions pf > / queue index 1 / end", > + "created") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / tcp src is 22 / = end actions pf > / queue index 2 / end", > + "created") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / sctp src is 33 /= end actions pf > / queue index 3 / end", > + "created") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / udp dst is 44 / = end actions pf > / queue index 4 / end", > + "created") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / tcp dst is 55 / = end actions pf > / queue index 5 / end", > + "created") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / sctp dst is 66 /= end actions pf > / queue index 6 / end", > + "created") > + > + self.sendpkt_check_result("11", "", 1, 1, "ipv4-udp") > + self.sendpkt_check_result("22", "", 2, 1, "ipv4-tcp") > + self.sendpkt_check_result("33", "", 3, 1, "ipv4-sctp") > + self.sendpkt_check_result("", "44", 4, 1, "ipv4-udp") > + self.sendpkt_check_result("", "55", 5, 1, "ipv4-tcp") > + self.sendpkt_check_result("", "66", 6, 1, "ipv4-sctp") > + > + # destroy > + self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ") > + > + self.sendpkt_check_result("11", "", 1, 0, "ipv4-udp") > + > + self.compare_memory_rules(5) > + > + # flush > + self.dut.send_expect("flow flush 0", "testpmd> ") > + > + self.sendpkt_check_result("22", "", 2, 0, "ipv4-tcp") > + > + self.compare_memory_rules(0) > + > + def test_negative(self): > + # unsupported rules > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / udp src is 156 d= st is 156 / > end actions pf / queue index 1 / end", > + "error") > + > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / udp src is 156 /= end actions > pf / queue index 1 / end", > + "create") > + > + # conflicted rules > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv4 / udp src is 156 /= end actions > pf / queue index 2 / end", > + "error") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / ipv6 / udp src is 156 /= end actions > pf / queue index 2 / end", > + "error") > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + self.destroy_env() > + self.dut.kill_all() > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + self.dut.kill_all() > -- > 2.17.1