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 BCD7EA04D9; Tue, 11 Aug 2020 08:30:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AEA691C00D; Tue, 11 Aug 2020 08:30:32 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3B03B4C9D for ; Tue, 11 Aug 2020 08:30:31 +0200 (CEST) IronPort-SDR: /iEmuQneFOiteyQYk+gC/t5xVQwZHzhXfQYckr1Ue7cUWSF/9cEK4ayD+5FJ3S5dykeihhEg8y x66HKbbUTH9w== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="154796054" X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="154796054" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 23:30:30 -0700 IronPort-SDR: 6MNJqBxDAWEjILgcmBkgJUfdY1F2CBK+DLaDYWKqKHUSYzJjzvtSBMhweHRPWzhk9cjjoMiRY+ /sF7xPP/hE6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="308311910" Received: from intel.sh.intel.com ([10.239.255.48]) by orsmga002.jf.intel.com with ESMTP; 10 Aug 2020 23:30:29 -0700 From: Junyu Jiang To: dts@dpdk.org Cc: Junyu Jiang Date: Tue, 11 Aug 2020 06:07:45 +0000 Message-Id: <20200811060745.16434-2-junyux.jiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811060745.16434-1-junyux.jiang@intel.com> References: <20200811032603.51352-1-junyux.jiang@intel.com> <20200811060745.16434-1-junyux.jiang@intel.com> Subject: [dts] [PATCH v2 2/2] tests/TestSuite_fortville_rss_input.py add flow query test case 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" add test case for rss flow query. Signed-off-by: Junyu Jiang --- tests/TestSuite_fortville_rss_input.py | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/TestSuite_fortville_rss_input.py b/tests/TestSuite_fortville_rss_input.py index d1ff39c..8a0c41e 100644 --- a/tests/TestSuite_fortville_rss_input.py +++ b/tests/TestSuite_fortville_rss_input.py @@ -3962,6 +3962,37 @@ class TestFortvilleRssGranularityConfig(TestCase): self.dut.send_expect("quit", "# ", 30) + def test_flow_query(self): + """ + Test the flow rule query. + """ + self.start_testpmd() + + self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types ipv4-tcp end queues end / end", "testpmd> ") + self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / udp / end actions rss types ipv4-udp l3-src-only end queues end func symmetric_toeplitz / end", "testpmd> ") + self.dut.send_expect("flow create 0 ingress pattern end actions rss types end queues end func simple_xor / end", "testpmd> ") + self.dut.send_expect("flow create 0 ingress pattern end actions rss types end queues 1 2 end / end", "testpmd> ") + + rexp = r"flow query 0 (\d) rss\r\r\nRSS:\r\n queues: ([\S\s]+?)\r\n function: (\S+?)\r\n types:\r\n ([\s\S]+)" + out0 = self.dut.send_expect("flow query 0 0 rss", "testpmd> ") + m0 = re.match(rexp, out0.strip()) + self.verify("none" == m0.group(2) and "default" == m0.group(3) and "ipv4-tcp" == m0.group(4) , "Query error") + out1 = self.dut.send_expect("flow query 0 1 rss", "testpmd> ") + m1 = re.match(rexp, out1.strip()) + self.verify("none" == m1.group(2) and "symmetric_toeplitz" == m1.group(3) and "ipv4-udp" in m1.group(4) and "l3-src-only" in m1.group(4) , "Query error") + out2 = self.dut.send_expect("flow query 0 2 rss", "testpmd> ") + m2 = re.match(rexp, out2.strip()) + self.verify("none" == m2.group(2) and "simple_xor" == m2.group(3) and "none" == m2.group(4) , "Query error") + out3 = self.dut.send_expect("flow query 0 3 rss", "testpmd> ") + m3 = re.match(rexp, out3.strip()) + self.verify("1 2" == m3.group(2) and "default" == m3.group(3) and "none" == m3.group(4) , "Query error") + + self.dut.send_expect("flow flush 0", "testpmd> ") + out4 = self.dut.send_expect("flow query 0 0 rss", "testpmd> ") + self.verify("Flow rule #0 not found" in out4, "Failed to rss query!") + + self.dut.send_expect("quit", "# ", 30) + def tear_down(self): """ Run after each test case. -- 2.17.1