From patchwork Mon Jun 21 10:10:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 94572 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F0006A0547; Mon, 21 Jun 2021 03:42:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B769140040; Mon, 21 Jun 2021 03:42:07 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 0262D4003F for ; Mon, 21 Jun 2021 03:42:05 +0200 (CEST) IronPort-SDR: ruRVmFsbWzfZBV/xIJKqF5IpSvv/XWLErQna+iW8GTLt55eOSxb8ihZKGRQOXU3gMIfJTaoXu0 UGd0uQBS7kgA== X-IronPort-AV: E=McAfee;i="6200,9189,10021"; a="203740054" X-IronPort-AV: E=Sophos;i="5.83,288,1616482800"; d="scan'208";a="203740054" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2021 18:42:04 -0700 IronPort-SDR: iSruBAp/rcjCVIaN9dd2x29j8ktLHCVbAkvml5yAu9rUOwUhAbBMUT+JlfoW4EbKFIKSR7skM3 kKnJDODaL+Kg== X-IronPort-AV: E=Sophos;i="5.83,288,1616482800"; d="scan'208";a="641184243" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2021 18:42:03 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Mon, 21 Jun 2021 18:10:55 +0800 Message-Id: <20210621101055.11880-1-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V3] tests/generic_filter: use flow api replace legancy X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" *.use flow api replace legancy filter command Signed-off-by: Zhimin Huang --- tests/TestSuite_generic_filter.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py index d4ea8926..b34c9dd0 100644 --- a/tests/TestSuite_generic_filter.py +++ b/tests/TestSuite_generic_filter.py @@ -729,7 +729,6 @@ class TestGeneric_filter(TestCase): "vlan set filter off %s" % valports[0], "testpmd> ") self.dut.send_expect( "vlan set filter off %s" % valports[1], "testpmd> ") - frames_to_send = 1 queue = ['64', '127', '128'] for i in [0, 1, 2]: @@ -739,30 +738,31 @@ class TestGeneric_filter(TestCase): if 'Invalid RX queue %s' % (queue[i]) not in out: set_filter_flag = 0 break - out = self.dut.send_expect( - "5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue %s " % (valports[0], (i + 1), queue[i]), "testpmd> ") - if 'error' not in out: + cmd = "flow create {} ingress pattern eth / ".format( + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format( + i + 1) + "end actions queue index {} / end".format(queue[i]) + out = self.dut.send_expect(cmd, "testpmd> ") + if 'Invalid argument' not in out: set_filter_flag = 0 break continue else: self.dut.send_expect("set stat_qmap rx %s %s %s" % (valports[0], queue[i], (i + 1)), "testpmd> ") - out = self.dut.send_expect("5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority %d queue %s " % ( - valports[0], (i + 1), (3 - i), queue[i]), "testpmd> ") + cmd = "flow create {} ingress pattern eth / ".format( + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format( + i + 1) + "end actions queue index {} / end".format(queue[i]) + self.dut.send_expect(cmd, "testpmd> ") self.dut.send_expect("start", "testpmd> ", 120) global filters_index filters_index = i self.filter_send_packet("packet") time.sleep(1) out = self.dut.send_expect("stop", "testpmd> ") - cmd = "Stats reg %s RX-packets: ([0-9]+)" % ( - i + 1) - result_scanner = r"%s" % cmd - scanner = re.compile(result_scanner, re.DOTALL) - m = scanner.search(out) - cur_pkt = m.group(1) - if int(cur_pkt) != frames_to_send: + p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)") + res = p.findall(out) + queues = [int(i) for i in res] + if queues[0] != int(queue[i]): packet_flag = 0 break self.dut.send_expect("quit", "#", timeout=30)