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 1628EA034C; Tue, 18 Aug 2020 03:59:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC0E51C01B; Tue, 18 Aug 2020 03:59:34 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 519541DB9 for ; Tue, 18 Aug 2020 03:59:31 +0200 (CEST) IronPort-SDR: og2X4jg4bg95vt0eDCbEzNbv8dfg1fzdsNg8LpNJS5BHVa3d3o+WNIhKyBVbpb/zFRnlZ/nXUo uE1Vm07jGaxw== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="154081555" X-IronPort-AV: E=Sophos;i="5.76,325,1592895600"; d="scan'208";a="154081555" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 18:59:30 -0700 IronPort-SDR: EmAVOCzH/PmhXGpVKUVfJsIpCTy5i95xaJk/uWgzbsAFjRh1gE5UJFkCAcV98ZQ8ju6GjZNJ4W UOQUm6OADcSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,325,1592895600"; d="scan'208";a="370748652" Received: from orsmsx603-2.jf.intel.com (HELO ORSMSX603.amr.corp.intel.com) ([10.22.229.83]) by orsmga001.jf.intel.com with ESMTP; 17 Aug 2020 18:59:30 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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 18:59:30 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) 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 18:59:30 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.59) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Aug 2020 18:59:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0cvrd5qtzeCjybTyoxy+C1DBzLthhHa7FOjUYuo+ArifkApY7IPmC3UbkQxvMubB/S19/4KXTuigc7bhqaVFVay6/tOvJ0GIwqkd27DMeXmThHlDpmSkB2IKI3dMW9LYvjd7lUQh1BYjEMhujGYd/eg/Tgt9kq9rHIOxPHFdnCkfWlUI71Zyrt0MwTXnkHGrcf6xXD4QnckoUBJ/ayFhQK7/riHEJ1gt8+g7BrN67JLalOeDU4tE2zMpTVY24bP18uZbG0UQXJLnHhLbivkbbBu4a0L0m/mpQrWmGTz4d5Jw6FQDnExL0wzBqWsEeCuutW5hS7xfgIQHZeQRdMEeA== 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=zV81M9+BDrAP666wQL16JaYoRVzRxQKXxetcA0Yddsk=; b=V7ikhfTtfb+sLmwU8WEiej+tXDKaBNwKzvNqd0UZ8laBpwMPF/g0TTmnAW6Leo550YojQ/QZ4gJz5/RdmbUbhX0lmmfEJtivrEZ5fRAG1dNTGjWUszC49YnAaMDsv1sYtTO4QY29j9X4EO89PIObZ63N0WlaNQ9ITqPDRGeATxgMDRF7DNrtDVFL8hGPRH55LeM6y715Dws9kK/5W4gN8fqQ2g6+irqbPcYx+JHHd4ttR4OKXf9JEpj8Lw133krKw/6OGbmgteeoIe2G3oTT24wLGWoHC+GLaYY7YPjVU07r3DUvp8DThd7JhCH9ING2fWc8HsDEyY1gKeOF0l75GA== 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=zV81M9+BDrAP666wQL16JaYoRVzRxQKXxetcA0Yddsk=; b=GVwt3/8dxIJ0ZfEhIZVDXfaqIi1OP64P4WqCRnoygmOiBP23NbQpEWJal9xK9q685izEMNPzCf7MvGB5RqmugmDgQxSe6dXBoJlWzqaOQWw3hmp/SW/uQCqGttY1ehysBDa+jj/x6YMGa2hljGDZDBtugTD1Z+B/EdSVRK3UcjQ= Received: from BL0PR11MB3364.namprd11.prod.outlook.com (2603:10b6:208:69::21) by MN2PR11MB4664.namprd11.prod.outlook.com (2603:10b6:208:26e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15; Tue, 18 Aug 2020 01:59:26 +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 01:59:26 +0000 From: "Lin, Xueqin" To: "Sun, GuinanX" , "dts@dpdk.org" CC: "Sun, GuinanX" Thread-Topic: [dts] [PATCH v2 2/2] tests/TestSuite_cloud_filter_with_l4_port.py add test cases Thread-Index: AQHWdHJULnEuyv2/a021DxGgCm44aqk9HMqw Date: Tue, 18 Aug 2020 01:59:26 +0000 Message-ID: References: <20200817055452.68792-1-guinanx.sun@intel.com> <20200817083411.71430-1-guinanx.sun@intel.com> <20200817083411.71430-2-guinanx.sun@intel.com> In-Reply-To: <20200817083411.71430-2-guinanx.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmU2YmVmZjItZmExNS00ZWY5LTk1NmEtNGI4MjgzYWYzOGMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVmR1b0pJZGVRWkhiVU9oSUNYRlBvN0s2cUp5RU5QQ3pFU2JHTStvRjljZUNwN0NIRzloU1FYZDlobXo2dmd2dSJ9 x-ctpclassification: CTP_NT 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.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 009727da-632b-4dfb-996e-08d8431a55ea x-ms-traffictypediagnostic: MN2PR11MB4664: 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:175; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GO2WfPIxaq5NLqSuKIP+poRx5XSwUWszSMOQpzvExNnjg/hKaEN2RXNxDAglruJ38idSZ38Bfmy+mGqCQ8yA1RV51m6f6d2NSgTJ98bxQb1JmeO+zrsBHN19Y+sFPZT7cVu+F5cLkUpfwRccc9dWX2wjFmvobhtrSQTeiZucIOLyLspKGE2l5AX3afO36SESATXNkrf+KaKLG7P9FOhFOt23+PDdvqUHnsauLt6Lyq1rynSNQRUvcB4WL0Qkhi358AA7/6vvHCtxjGYfFUZ3fyPJkoWZ7XIh6tqmFGcuju5EewFoCFTeGmYZc1EylzgR 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)(376002)(366004)(396003)(346002)(39860400002)(136003)(7696005)(76116006)(186003)(55016002)(107886003)(66476007)(26005)(33656002)(71200400001)(66556008)(64756008)(6506007)(66946007)(53546011)(8936002)(66446008)(2906002)(83380400001)(478600001)(86362001)(5660300002)(52536014)(30864003)(316002)(19627235002)(4326008)(110136005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: EZpIDi2vDvoc4q3LSAVrK0h/5JMIc1cr62eoWkTy3WYUaHDvY5E3OUwLsYhRhWIVZvZjrxfpcZmpKjiak4Rb12+bIKzGx9y1eQoDNCHVrz+yqrWV63JdxFnut3GwShoFMnzngpUQreFvI5QQbl2HKUVx2yocikNSC0cW48ZM3ZGT6o90HmchDvZIHUvqcEltb/dgmbUelQ+pggDQKJdFcfMdrt4RM0WsYrXdUQ1us8LQ21xke+F8DXkg+IFCL/Nn6deN1WJQSDdWAYGX8ByO4RjG5/L/w7Z8ljadjPp0mZyeBkODd+P6TZvLyDnwUqskixOvBQazTu90fIuHGMfP33imadwyTpa4LCLmGbYIe1YMUYgrVSyuzuKVJdBa+B6bR8MUHvjEI67GsPV3dR/OB/Ei/JHHysD3hr8Gu737AbTt1g0vTBBnj0pKYYFdqWeAr7JG8CWsyFgVjcgKwmz6NrYVJiG1jjJWnmQ6zwQ5B6OclPO6Lnzaw4ynlqkheLvIXZQIx/FhAXwDXngu2Bisj13sttP3dKb9GzionoEr3vR/3UUUbE+j8ZjZefm9FvSweAw4AvSQJJpSbN5C6soBc4VGO/PCWk8b4Xm7r36HS3IIPJGJpuo7DkAEpJ5XIOwb0nmPcCUDxiBHrmm7dQXr5A== 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: 009727da-632b-4dfb-996e-08d8431a55ea X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2020 01:59:26.0994 (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: bHPVAiyIpdjAG8p0uHQVCknq3uO3c4/HkX4rrmS2WTaAFbaZdsPZ8krwNwWIuG3cYbUVucGsNSPZbQ//slobmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4664 X-OriginatorOrg: intel.com Subject: Re: [dts] [PATCH v2 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" Some comment as below.=20 Best regards, Xueqin > -----Original Message----- > From: dts On Behalf Of Guinan Sun > Sent: Monday, August 17, 2020 4:34 PM > To: dts@dpdk.org > Cc: Sun, GuinanX > Subject: [dts] [PATCH v2 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 | 400 +++++++++++++++++++ > 1 file changed, 400 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..37b646e > --- /dev/null > +++ b/tests/TestSuite_cloud_filter_with_l4_port.py > @@ -0,0 +1,400 @@ > +# 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 fdir vlan filter" % self.nic) Wrong for "not support fdir vlan filter" > + > + 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 destroied with success destroyed > + 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, > pctype=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): > + """ > + only supported by i40e > + """ Should not have the sentence, above have check the NIC type, same as below= .=20 > + # 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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + #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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + #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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + #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): > + """ > + only supported by i40e > + """ > + # 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): > + """ > + only supported by i40e > + """ > + #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): > + """ > + only supported by i40e > + """ > + 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): > + """ > + only supported by i40e > + """ > + # 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