From patchwork Tue Sep 28 01:53:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Jangra X-Patchwork-Id: 99876 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 741EDA0032; Tue, 28 Sep 2021 11:03:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7067A410DB; Tue, 28 Sep 2021 11:03:25 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id D7F2D410DB for ; Tue, 28 Sep 2021 11:03:23 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="224303790" X-IronPort-AV: E=Sophos;i="5.85,329,1624345200"; d="scan'208";a="224303790" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 02:03:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,329,1624345200"; d="scan'208";a="616442116" Received: from ena-4.iind.intel.com ([10.190.200.151]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2021 02:03:20 -0700 From: Yogesh Jangra To: dts@dpdk.org Cc: venkata.suresh.kumar.p@intel.com, churchill.khangar@intel.com, yogesh.jangra@intel.com Date: Mon, 27 Sep 2021 21:53:03 -0400 Message-Id: <1632793983-301126-3-git-send-email-yogesh.jangra@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1632793983-301126-1-git-send-email-yogesh.jangra@intel.com> References: <1632793983-301126-1-git-send-email-yogesh.jangra@intel.com> Subject: [dts] [PATCH 2/2] tests/pipeline: add variable bit and learner table test suite 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" This patch has the pipeline test suite changes to cover the scenarios on variable bit field headers and learner table features. Signed-off-by: Yogesh Jangra Signed-off-by: Churchill Khangar Tested-by: Venkata Suresh Kumar P --- tests/TestSuite_pipeline.py | 138 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 126 insertions(+), 12 deletions(-) diff --git a/tests/TestSuite_pipeline.py b/tests/TestSuite_pipeline.py index e00f2e9..b6dc890 100644 --- a/tests/TestSuite_pipeline.py +++ b/tests/TestSuite_pipeline.py @@ -423,16 +423,22 @@ class TestPipeline(TestCase): def run_dpdk_app(self, cli_file): - cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci - self.dut.send_expect(cmd, "# ", 20) - cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci - self.dut.send_expect(cmd, "# ", 20) - cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci - self.dut.send_expect(cmd, "# ", 20) - cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci - self.dut.send_expect(cmd, "# ", 20) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cmd = "test -f {} && echo \"File exists!\"".format(cli_file) + self.dut.send_expect(cmd, "File exists!", 1) + try: + cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci + self.dut.send_expect(cmd, "# ", 20) + cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci + self.dut.send_expect(cmd, "# ", 20) + cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci + self.dut.send_expect(cmd, "# ", 20) + cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci + self.dut.send_expect(cmd, "# ", 20) + cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) + self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + except Exception: + self.dut.send_expect("^C", "# ", 20) + self.verify(0, "ERROR in running DPDK application") def send_pkts(self, from_port, to_port, in_pcap): """ @@ -4491,12 +4497,31 @@ class TestPipeline(TestCase): def test_ring_port_001(self): cli_file = '/tmp/pipeline/ring_port_001/ring_port_001.cli' - self.run_dpdk_app(cli_file) + cmd = "test -f {} && echo \"File exists!\"".format(cli_file) + self.dut.send_expect(cmd, "File exists!", 10) + try: + cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci + self.dut.send_expect(cmd, "# ", 10) + cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci + self.dut.send_expect(cmd, "# ", 10) + cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci + self.dut.send_expect(cmd, "# ", 10) + cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci + self.dut.send_expect(cmd, "# ", 10) + + ports = [self.dut_p0_pci, self.dut_p1_pci, self.dut_p2_pci, self.dut_p3_pci] + vdevs = ['net_ring0'] + eal_params = self.dut.create_eal_parameters(cores=list(range(4)), ports=ports, vdevs=vdevs) + cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, eal_params, cli_file) + self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + except Exception: + self.dut.send_expect("^C", "# ", 20) + self.verify(0, "ERROR in running DPDK application") in_pcap = 'pipeline/ring_port_001/pcap_files/in_1.txt' out_pcap = 'pipeline/ring_port_001/pcap_files/out_1.txt' self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "udp") - self.dut.send_expect("^C", "# ", 20) + self.dut.send_expect("^C", "# ", 10) def test_u100_001(self): @@ -4884,6 +4909,95 @@ class TestPipeline(TestCase): # self.send_scapy_pkts(0) pass + def test_profile_001(self): + + cli_file = '/tmp/pipeline/profile_001/profile_001.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/profile_001/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/profile_001/pcap_files/out_1.txt' + out_pcap_2 = 'pipeline/profile_001/pcap_files/out_2.txt' + out_pcap_3 = 'pipeline/profile_001/pcap_files/out_3.txt' + out_pcap_4 = 'pipeline/profile_001/pcap_files/out_4.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4] + filters = ["tcp"] * 4 + tx_port = [0] + rx_port = [0, 1, 2, 3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) + + def test_varbit_001(self): + + cli_file = '/tmp/pipeline/varbit_001/varbit_001.cli' + self.run_dpdk_app(cli_file) + + in_pcap = 'pipeline/varbit_001/pcap_files/in_1.txt' + out_pcap = 'pipeline/varbit_001/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "tcp") + self.dut.send_expect("^C", "# ", 20) + + def test_learner_001(self): + + cli_file = '/tmp/pipeline/learner_001/learner_001.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/learner_001/pcap_files/in_1.txt'] + out_pcap = ['pipeline/learner_001/pcap_files/out_1.txt'] + filters = ["tcp"] + tx_port = [0] + rx_port = [0] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_001/pcap_files/in_2.txt'] + out_pcap = ['pipeline/learner_001/pcap_files/out_2.txt'] + filters = ["tcp"] + tx_port = [1] + rx_port = [1] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_001/pcap_files/in_3.txt'] + out_pcap = ['pipeline/learner_001/pcap_files/out_3.txt'] + filters = ["tcp"] + tx_port = [2] + rx_port = [2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_001/pcap_files/in_4.txt'] + out_pcap = ['pipeline/learner_001/pcap_files/out_4.txt'] + filters = ["tcp"] + tx_port = [3] + rx_port = [3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) + + def test_learner_002(self): + + cli_file = '/tmp/pipeline/learner_002/learner_002.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/learner_002/pcap_files/in_1.txt'] + out_pcap = ['pipeline/learner_002/pcap_files/out_1.txt'] + filters = ["tcp"] + tx_port = [0] + rx_port = [0] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_002/pcap_files/in_2.txt'] + out_pcap = ['pipeline/learner_002/pcap_files/out_2.txt'] + filters = ["tcp"] + tx_port = [1] + rx_port = [1] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_002/pcap_files/in_3.txt'] + out_pcap = ['pipeline/learner_002/pcap_files/out_3.txt'] + filters = ["tcp"] + tx_port = [2] + rx_port = [2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + in_pcap = ['pipeline/learner_002/pcap_files/in_4.txt'] + out_pcap = ['pipeline/learner_002/pcap_files/out_4.txt'] + filters = ["tcp"] + tx_port = [3] + rx_port = [3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) + def tear_down(self): """ Run after each test case.