From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB7C4A034D; Tue, 11 Jan 2022 10:09:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1C2A4121E; Tue, 11 Jan 2022 10:09:40 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id ADBED411AE for ; Tue, 11 Jan 2022 10:09:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641892179; x=1673428179; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ru4pUiQT5V5YAgmQRz9KT6jTNpa4t+Kn4epWezOGS0c=; b=IRFUsc/c4TA49ZG9oiIa5+rNgzxej3TkbudiMsoktyDBA99g4SMIdfSQ tsKpoleGoiOAvcCb6fJw1L9lp8PTVAg9zHWMUQbJJUZ6E1d8hzDkI79ax 8GQoWbYR3E5QgCO38CN1d0onKwzcUEfz47spm1OMCS7y0wa5OSgy83CqF La1RGaqx0krIC2Ev/IqiipQeZ80f20/LYfh6kqrXcyNIEFWI40zmg0LMY KaNvXS8RXp4ESJveiM67PbahAFfCpAgzSdUxwBClqOGL/kLPswZ7Zeh9x VQ9fypDnGffVjTymoIlBrP9PwNTv2rS5cOdjMTz0oQ8BahK7w+FlKJHDj A==; X-IronPort-AV: E=McAfee;i="6200,9189,10223"; a="243640587" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="243640587" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 01:09:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="558301618" Received: from ena-4.iind.intel.com ([10.190.200.151]) by orsmga001.jf.intel.com with ESMTP; 11 Jan 2022 01:09:29 -0800 From: Yogesh Jangra To: dts@dpdk.org Cc: venkata.suresh.kumar.p@intel.com, harshad.suresh.narayane@intel.com, yogesh.jangra@intel.com Subject: [PATCH 2/2] tests/pipeline: add support for annotations in pipeline test suite Date: Mon, 10 Jan 2022 20:55:38 -0500 Message-Id: <1641866138-122679-3-git-send-email-yogesh.jangra@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641866138-122679-1-git-send-email-yogesh.jangra@intel.com> References: <1641866138-122679-1-git-send-email-yogesh.jangra@intel.com> 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 This patch has P4 action annotation support, port type and updates for mempool size to add support to run the suite on virtual machine. Signed-off-by: Yogesh Jangra Signed-off-by: Harshad Suresh Narayane Tested-by: Venkata Suresh Kumar P --- tests/TestSuite_pipeline.py | 155 +++++++++++++++++++++++++++++++++++- 1 file changed, 153 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_pipeline.py b/tests/TestSuite_pipeline.py index 842b2acd..5e711f4b 100644 --- a/tests/TestSuite_pipeline.py +++ b/tests/TestSuite_pipeline.py @@ -65,6 +65,7 @@ PAYLOAD = re.compile(r'\t0x([0-9a-fA-F]+): ([0-9a-fA-F ]+)') FILE_DIR = os.path.dirname(os.path.abspath(__file__)).split(os.path.sep) DEP_DIR = os.path.sep.join(FILE_DIR[:-1]) + '/dep/' +DIR_RTE_INSTALL_DIR = '/root/dpdk' BUFFER_SIZE = 1024 CLI_SERVER_CONNECT_DELAY = 1 @@ -370,6 +371,9 @@ class TestPipeline(TestCase): self.session_secondary.copy_file_to('dep/pipeline.tar.gz', '/tmp/') self.dut.send_expect('tar -zxf /tmp/pipeline.tar.gz --directory /tmp', "# ", 20) + # update environment variable for the performance improvement + self.dut.send_expect("export RTE_INSTALL_DIR={}".format(DIR_RTE_INSTALL_DIR), "#") + def set_up(self): """ Run before each test case. @@ -416,7 +420,7 @@ class TestPipeline(TestCase): self.dut.send_expect("^C", "# ", 20) self.verify(0, "CLI Response Error") - def run_dpdk_app(self, cli_file): + def run_dpdk_app(self, cli_file, exp_out = "PIPELINE0 enable"): cmd = "test -f {} && echo \"File exists!\"".format(cli_file) self.dut.send_expect(cmd, "File exists!", 1) @@ -430,7 +434,7 @@ class TestPipeline(TestCase): 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) + self.dut.send_expect(cmd, exp_out, 60) except Exception: self.dut.send_expect("^C", "# ", 20) self.verify(0, "ERROR in running DPDK application") @@ -4518,6 +4522,34 @@ class TestPipeline(TestCase): self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "udp") self.dut.send_expect("^C", "# ", 10) + def test_ring_port_002(self): + + cli_file = '/tmp/pipeline/ring_port_002/ring_port_002.cli' + 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] + eal_params = self.dut.create_eal_parameters(cores=list(range(4)), ports=ports) + 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_002/pcap_files/in_1.txt' + out_pcap = 'pipeline/ring_port_002/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "tcp") + self.dut.send_expect("^C", "# ", 10) + def test_u100_001(self): cli_file = '/tmp/pipeline/u100_001/u100_001.cli' @@ -4608,6 +4640,55 @@ class TestPipeline(TestCase): self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) self.dut.send_expect("^C", "# ", 20) + def test_u100_003(self): + + cli_file = '/tmp/pipeline/u100_003/u100_003.cli' + self.run_dpdk_app(cli_file) + base_dir = 'pipeline/u100_003/pcap_files/' + + # TCP Packets + in_pcap = ['in_1.txt'] + in_pcap = [base_dir + s for s in in_pcap] + out_pcap = ['out_11.txt', 'out_12.txt', 'out_13.txt', 'out_14.txt'] + out_pcap = [base_dir + s for s in out_pcap] + filters = ["tcp", "vlan 16", "vlan 16", "tcp"] + tx_port = [0] + rx_port = [0, 1, 2, 3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + + # UDP Packets + in_pcap = ['in_2.txt'] + in_pcap = [base_dir + s for s in in_pcap] + out_pcap = ['out_21.txt', 'out_22.txt', 'out_23.txt', 'out_24.txt'] + out_pcap = [base_dir + s for s in out_pcap] + filters = ["udp port 200", "vlan 16", "vlan 16", "udp port 200"] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + + # ICMP Packets + in_pcap = ['in_3.txt'] + in_pcap = [base_dir + s for s in in_pcap] + out_pcap = ['out_31.txt', 'out_32.txt', 'out_33.txt', 'out_34.txt'] + out_pcap = [base_dir + s for s in out_pcap] + filters = ["icmp", "vlan 16", "vlan 16", "icmp"] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + + # IGMP Packets + in_pcap = ['in_4.txt'] + in_pcap = [base_dir + s for s in in_pcap] + out_pcap = ['out_41.txt', 'out_42.txt', 'out_43.txt', 'out_44.txt'] + out_pcap = [base_dir + s for s in out_pcap] + filters = ["igmp", "vlan 16", "vlan 16", "igmp"] * 4 + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + + # IPv6 Packets + in_pcap = ['in_5.txt'] + in_pcap = [base_dir + s for s in in_pcap] + out_pcap = ['out_51.txt', 'out_52.txt', 'out_53.txt', 'out_54.txt'] + out_pcap = [base_dir + s for s in out_pcap] + filters = ["tcp"] * 4 + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) + def test_lpm_001(self): cli_file = '/tmp/pipeline/lpm_001/lpm_001.cli' @@ -4993,6 +5074,76 @@ class TestPipeline(TestCase): self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) self.dut.send_expect("^C", "# ", 20) + def test_annotation_001(self): + + cli_file = '/tmp/pipeline/annotation_001/annotation_001.cli' + self.run_dpdk_app(cli_file,'thread 1 pipeline PIPELINE0 enable\n') + + in_pcap = ['pipeline/annotation_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/annotation_001/pcap_files/out_1.txt'] * 4 + filters = ["tcp"] * 4 + tx_port = [0, 1, 2, 3] + 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_annotation_002(self): + + cli_file = '/tmp/pipeline/annotation_002/annotation_002.cli' + self.run_dpdk_app(cli_file,'thread 1 pipeline PIPELINE0 enable\n') + + in_pcap = ['pipeline/annotation_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/annotation_002/pcap_files/out_1.txt'] * 4 + filters = ["tcp"] * 4 + tx_port = [0, 1, 2, 3] + 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_annotation_003(self): + + cli_file = '/tmp/pipeline/annotation_003/annotation_003.cli' + self.run_dpdk_app(cli_file,'pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 1\n') + + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + CLI_CMD = 'pipeline PIPELINE0 build /tmp/pipeline/annotation_003/annotation_003.spec\n' + self.socket_send_cmd(s, CLI_CMD, "Error -22 at line 54: Invalid action name statement.") + s.close() + + self.dut.send_expect("^C", "# ", 20) + + def test_annotation_004(self): + + cli_file = '/tmp/pipeline/annotation_004/annotation_004.cli' + self.run_dpdk_app(cli_file,'pipeline PIPELINE0 build /tmp/pipeline/annotation_004/'\ + 'annotation_004.spec\n') + + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + CLI_CMD = 'pipeline PIPELINE0 table annotation_004 add /tmp/pipeline/annotation_004/'\ + 'annotation_004_table.txt\n' + self.socket_send_cmd(s, CLI_CMD, "Invalid entry in file /tmp/pipeline/annotation_004/"\ + "annotation_004_table.txt at line 2\n") + s.close() + + self.dut.send_expect("^C", "# ", 20) + + def test_annotation_005(self): + + cli_file = '/tmp/pipeline/annotation_005/annotation_005.cli' + self.run_dpdk_app(cli_file,'pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 1\n') + + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + CLI_CMD = 'pipeline PIPELINE0 build /tmp/pipeline/annotation_005/annotation_005.spec\n' + self.socket_send_cmd(s, CLI_CMD, "Error -22 at line 62: Table configuration error.") + s.close() + + self.dut.send_expect("^C", "# ", 20) + def tear_down(self): """ Run after each test case. -- 2.25.1