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 E4246A0547; Wed, 21 Apr 2021 12:14:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA0EF41A4E; Wed, 21 Apr 2021 12:14:36 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 76E4B419D3 for ; Wed, 21 Apr 2021 12:14:34 +0200 (CEST) IronPort-SDR: EYDdzZSykObtCzui7KWfKpVBHot1hHiBXPeE7CJQWzbWFjnJ3DliPxQnfFs0gXzshFPBvce+6W fLxrEM4gAaSw== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="195229781" X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="195229781" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 03:14:33 -0700 IronPort-SDR: 5hOSkXDmg9MhQPH0XA5miPfvVA3keyGIgZcqZz6sHoPikv8r2mSVnjP7KHmEvYD9BX61STxtCm vLTFrI3oO0tA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="463537304" Received: from fourhctwonone.iind.intel.com (HELO bdcdev09.localdomain) ([10.190.193.143]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2021 03:14:29 -0700 From: Churchill Khangar To: dts@dpdk.org Cc: cristian.dumitrescu@intel.com, venkata.suresh.kumar.p@intel.com, churchill.khangar@intel.com, yogesh.jangra@intel.com Date: Wed, 21 Apr 2021 06:17:14 -0400 Message-Id: <1619000234-46133-3-git-send-email-churchill.khangar@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1619000234-46133-1-git-send-email-churchill.khangar@intel.com> References: <1619000234-46133-1-git-send-email-churchill.khangar@intel.com> Subject: [dts] [PATCH 2/2] tests/pipeline: add new features test coverage 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 new features and enhancements to existing tests. Following are the details of new features and existing test cases enhancements 1. Framework enhancements to improve overall execution time. 2. RING I/O port type 3. WCM table match 4. Register Array 5. trTCM 6. Enhancement to existing test cases to verify a. Endianness issue b. Operands with variable size values 7. Additional tests to provide more coverage for table match and actions 8. Additional tests to cover customer common use cases Signed-off-by: Churchill Khangar Signed-off-by: Yogesh Jangra Tested-by: Venkata Suresh Kumar P --- tests/TestSuite_pipeline.py | 8416 +++++++++++++++++++------------------------ 1 file changed, 3661 insertions(+), 4755 deletions(-) diff --git a/tests/TestSuite_pipeline.py b/tests/TestSuite_pipeline.py index 9597896..d1f4d50 100644 --- a/tests/TestSuite_pipeline.py +++ b/tests/TestSuite_pipeline.py @@ -65,12 +65,17 @@ from scapy.sendrecv import sendp import itertools +MODE = 1 # 0: Development, 1: Release + TIMESTAMP = re.compile(r'\d{2}\:\d{2}\:\d{2}\.\d{6}') 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/' +BUFFER_SIZE = 1024 +CLI_SERVER_CONNECT_DELAY = 1 + class TestPipeline(TestCase): @@ -200,9 +205,52 @@ class TestPipeline(TestCase): self.convert_tcpdump_to_text2pcap('/tmp/packet_rx.txt', '/tmp/packet_rx_rcv.txt') out = self.tester.send_command( 'diff -sqw /tmp/packet_rx_rcv.txt {}'.format('/tmp/' + out_pcap_file), timeout=0.5) - if "differ" in out: + if "are identical" not in out: + self.dut.send_expect('^C', '# ') + self.verify(False, "Output pcap files mismatch error") + + def send_and_sniff_multiple(self, from_port, to_port, in_pcap, out_pcap, filters, rate=0): + + self.tester.send_expect('rm -f /tmp/*.txt /tmp/*.pcap /tmp/*.out', '# ') + tx_count = len(from_port) + rx_count = len(to_port) + tx_port, rx_port, tx_inf, rx_inf = ([] for i in range(4)) + + for i in range(tx_count): + tx_port.append(self.tester.get_local_port(self.dut_ports[from_port[i]])) + tx_inf.append(self.tester.get_interface(tx_port[i])) + + for i in range(rx_count): + rx_port.append(self.tester.get_local_port(self.dut_ports[to_port[i]])) + rx_inf.append(self.tester.get_interface(rx_port[i])) + self.tcpdump_start_sniff(rx_inf[i], filters[i]) + + self.tester.scapy_foreground() + for i in range(tx_count): + self.tester.send_expect( + 'text2pcap -q {} /tmp/tx_{}.pcap'.format('/tmp/' + in_pcap[i], tx_inf[i]), '# ') + self.tester.scapy_append('pkt = rdpcap("/tmp/tx_{}.pcap")'.format(tx_inf[i])) + if rate: + self.tester.scapy_append( + 'sendp(pkt, iface="{}", count=1, inter=1./{})'.format(tx_inf[i], rate)) + else: + self.tester.scapy_append('sendp(pkt, iface="{}", count=1)'.format(tx_inf[i])) + + self.tester.scapy_execute() + self.tcpdump_stop_sniff() + mismatch_count = 0 + for i in range(rx_count): + self.tester.send_expect( + 'tcpdump -n -r /tmp/tcpdump_{}.pcap -xx > /tmp/packet_rx.txt'.format(rx_inf[i]), '# ') + self.convert_tcpdump_to_text2pcap( + '/tmp/packet_rx.txt', '/tmp/packet_rx_rcv_{}.txt'.format(rx_inf[i])) + cmd = 'diff -sqw /tmp/packet_rx_rcv_{}.txt {}'.format(rx_inf[i], '/tmp/' + out_pcap[i]) + out = self.tester.send_command(cmd, timeout=0.5) + if "are identical" not in out: + mismatch_count += 1 + if mismatch_count: self.dut.send_expect('^C', '# ') - self.verify("are identical" in out, "Output pcap files mismatch error") + self.verify(False, "Output pcap files mismatch error") def setup_env(self, port_nums, driver): """ @@ -279,7 +327,7 @@ class TestPipeline(TestCase): self.vf3_mac = "00:11:22:33:44:58" ports = [self.dut_p0_pci, self.dut_p1_pci, self.dut_p2_pci, self.dut_p3_pci] - self.eal_para = self.dut.create_eal_parameters(cores=list(range(2)), ports=ports) + self.eal_para = self.dut.create_eal_parameters(cores=list(range(4)), ports=ports) self.sriov_vfs_port = [] self.session_secondary = self.dut.new_session() @@ -289,10 +337,13 @@ class TestPipeline(TestCase): self.app_testpmd_path = self.dut.apps_name['test-pmd'] self.param_flow_dir = self.get_flow_direction_param_of_tcpdump() - # update the ./dep/pipeline.tar.gz file for any new changes - P4_PIPILINE_TAR_FILE = DEP_DIR + 'pipeline.tar.gz' + # update the ./dep/pipeline.tar.gz file + PIPELINE_TAR_FILE = DEP_DIR + 'pipeline.tar.gz' self.tester.send_expect('rm -rf /tmp/pipeline', '# ') - self.tester.send_expect('tar -zxf {} --directory /tmp'.format(P4_PIPILINE_TAR_FILE), "# ", 20) + if MODE == 0: # Development + self.tester.send_expect('rm -rf {}'.format(PIPELINE_TAR_FILE), '# ') + self.tester.send_expect('tar -czf {} -C {} pipeline/'.format(PIPELINE_TAR_FILE, DEP_DIR), '# ') + self.tester.send_expect('tar -zxf {} --directory /tmp'.format(PIPELINE_TAR_FILE), "# ", 20) # copy the ./dep/pipeline.tar.gz file to DUT self.dut.send_expect('rm -rf /tmp/pipeline.tar.gz /tmp/pipeline', "# ", 20) @@ -305,47 +356,44 @@ class TestPipeline(TestCase): """ pass - def test_rx_tx_001(self): - """ - rx_tx_001: revert the received packet on the same port without any change - """ - cli_file = '/tmp/pipeline/rx_tx_001/rx_tx_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/rx_tx_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/rx_tx_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def connect_cli_server(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + SERVER_IP = '192.168.122.216' + SERVER_PORT = 8086 - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + try: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.connect((SERVER_IP, SERVER_PORT)) + sleep(1) + msg = s.recv(BUFFER_SIZE) + response = msg.decode() + # print('Rxd: ' + response) + if "pipeline>" not in response: + s.close() + self.verify(0, "CLI Response Error") + else: + return s + except socket.error as err: + print("Socket connection failed with error %s" % (err)) + self.verify(0, "Failed to connect to server") + except socket.error as err: + print("Socket creation failed with error %s" % (err)) + self.verify(0, "Failed to create socket") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def socket_send_cmd(self, socket, cmd, expected_rsp): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + socket.send(cmd.encode('utf-8')) + sleep(0.1) + msg = socket.recv(BUFFER_SIZE) + response = msg.decode() + print('Rxd: ' + response) + if expected_rsp not in response: + socket.close() + self.dut.send_expect("^C", "# ", 20) + self.verify(0, "CLI Response Error") - def test_extract_emit_001(self): - """ - extract_emit_001: revert the received packet on the same port without any change - """ - cli_file = '/tmp/pipeline/extract_emit_001/extract_emit_001.cli' + 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) @@ -355,5249 +403,4107 @@ class TestPipeline(TestCase): 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) - - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + self.dut.send_expect(cmd, "PIPELINE0 enable", 75) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + def send_pkts(self, from_port, to_port, in_pcap_file): + """ + Send pkts read from the input pcap file. + """ + tx_port = self.tester.get_local_port(self.dut_ports[from_port]) + rx_port = self.tester.get_local_port(self.dut_ports[to_port]) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + tx_interface = self.tester.get_interface(tx_port) + rx_interface = self.tester.get_interface(rx_port) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + self.tester.send_expect('rm -f /tmp/*.txt /tmp/*.pcap /tmp/*.out', '# ') - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + # Prepare the pkts to be sent + self.tester.scapy_foreground() + self.tester.send_expect('text2pcap -q {} /tmp/packet_tx.pcap'.format('/tmp/' + in_pcap_file), '# ') + self.tester.scapy_append('pkt = rdpcap("/tmp/packet_tx.pcap")') + self.tester.scapy_append('sendp(pkt, iface="{}", count=1)'.format(tx_interface)) + self.tester.scapy_execute() - def test_extract_emit_002(self): + def test_rx_tx_001(self): - cli_file = '/tmp/pipeline/extract_emit_002/extract_emit_002.cli' + cli_file = '/tmp/pipeline/rx_tx_001/rx_tx_001.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/rx_tx_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/rx_tx_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_extract_emit_001(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_001/extract_emit_001.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/extract_emit_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_extract_emit_002(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_002/extract_emit_002.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/extract_emit_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_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_extract_emit_003(self): cli_file = '/tmp/pipeline/extract_emit_003/extract_emit_003.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/extract_emit_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_003/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_extract_emit_004(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_004/extract_emit_004.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/extract_emit_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_004/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_extract_emit_005(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_005/extract_emit_005.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/extract_emit_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_005/pcap_files/out_1.txt'] * 4 + filters = ["vlan"] * 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_extract_emit_004(self): + def test_extract_emit_006(self): - cli_file = '/tmp/pipeline/extract_emit_004/extract_emit_004.cli' + cli_file = '/tmp/pipeline/extract_emit_006/extract_emit_006.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/extract_emit_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_006/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4789"] * 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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_extract_emit_007(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_007/extract_emit_007.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/extract_emit_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_007/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4789"] * 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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_extract_emit_008(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/extract_emit_008/extract_emit_008.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/extract_emit_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_008/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4789"] * 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_extract_emit_005(self): + def test_extract_emit_009(self): - cli_file = '/tmp/pipeline/extract_emit_005/extract_emit_005.cli' + cli_file = '/tmp/pipeline/extract_emit_009/extract_emit_009.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/extract_emit_009/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/extract_emit_009/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_and_001(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_005/pcap_files/out_1.txt' - filters = "vlan" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_001/and_001.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/and_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_and_002(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_002/and_002.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = 'pipeline/and_002/pcap_files/in_1.txt' + out_pcap = 'pipeline/and_002/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(2, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(3, 0, in_pcap, out_pcap, "tcp") + self.dut.send_expect("^C", "# ", 20) - def test_extract_emit_006(self): + def test_and_003(self): - cli_file = '/tmp/pipeline/extract_emit_006/extract_emit_006.cli' + cli_file = '/tmp/pipeline/and_003/and_003.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/and_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_003/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_and_004(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_006/pcap_files/out_1.txt' - filters = "udp port 4789" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_004/and_004.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/and_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_004/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_and_005(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_005/and_005.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/and_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_005/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_extract_emit_007(self): + def test_and_006(self): - cli_file = '/tmp/pipeline/extract_emit_007/extract_emit_007.cli' + cli_file = '/tmp/pipeline/and_006/and_006.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/and_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_006/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_and_007(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_007/pcap_files/out_1.txt' - filters = "udp port 4789" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_007/and_007.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/and_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_007/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_and_008(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/and_008/and_008.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/and_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/and_008/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_extract_emit_008(self): + def test_or_001(self): - cli_file = '/tmp/pipeline/extract_emit_008/extract_emit_008.cli' + cli_file = '/tmp/pipeline/or_001/or_001.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/or_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_or_002(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_008/pcap_files/out_1.txt' - filters = "udp port 4789" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/or_002/or_002.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/or_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_or_003(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/or_003/or_003.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/or_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_003/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_extract_emit_009(self): + def test_or_004(self): - cli_file = '/tmp/pipeline/extract_emit_009/extract_emit_009.cli' + cli_file = '/tmp/pipeline/or_004/or_004.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/or_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_004/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_or_005(self): - # rule 0 test - in_pcap_file = 'pipeline/extract_emit_009/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/extract_emit_009/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/or_005/or_005.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/or_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_005/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_or_006(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/or_006/or_006.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/or_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_006/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_and_001(self): + def test_or_007(self): - cli_file = '/tmp/pipeline/and_001/and_001.cli' + cli_file = '/tmp/pipeline/or_007/or_007.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/or_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/or_007/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_or_008(self): - # rule 0 test - in_pcap_file = 'pipeline/and_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/or_008/or_008.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = 'pipeline/or_008/pcap_files/in_1.txt' + out_pcap = 'pipeline/or_008/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(1, 1, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(2, 3, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(3, 3, in_pcap, out_pcap, "tcp") + self.dut.send_expect("^C", "# ", 20) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_xor_001(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/xor_001/xor_001.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/xor_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_001/pcap_files/out_1.txt'] * 4 + filters = ["tcp"] * 4 + tx_port = [0, 1, 2, 3] + rx_port = [1, 0, 3, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) - def test_and_002(self): + def test_xor_002(self): - cli_file = '/tmp/pipeline/and_002/and_002.cli' + cli_file = '/tmp/pipeline/xor_002/xor_002.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/xor_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_xor_003(self): - # rule 0 test - in_pcap_file = 'pipeline/and_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/xor_003/xor_003.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/xor_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_003/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 0, in_pcap_file, out_pcap_file, filters) + def test_xor_004(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/xor_004/xor_004.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/xor_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_004/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_and_003(self): + def test_xor_005(self): - cli_file = '/tmp/pipeline/and_003/and_003.cli' + cli_file = '/tmp/pipeline/xor_005/xor_005.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/xor_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_005/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_xor_006(self): - # rule 0 test - in_pcap_file = 'pipeline/and_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/xor_006/xor_006.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/xor_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_006/pcap_files/out_1.txt'] * 4 + filters = ["tcp"] * 4 + tx_port = [0, 1, 2, 3] + rx_port = [1, 0, 3, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_xor_007(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/xor_007/xor_007.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/xor_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_007/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_and_004(self): + def test_xor_008(self): - cli_file = '/tmp/pipeline/and_004/and_004.cli' + cli_file = '/tmp/pipeline/xor_008/xor_008.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/xor_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/xor_008/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_add_001(self): - # rule 0 test - in_pcap_file = 'pipeline/and_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_001/add_001.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/add_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_add_002(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_002/add_002.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/add_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_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_and_005(self): + def test_add_003(self): - cli_file = '/tmp/pipeline/and_005/and_005.cli' + cli_file = '/tmp/pipeline/add_003/add_003.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/add_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_003/pcap_files/out_1.txt'] * 4 + filters = ["tcp"] * 4 + tx_port = [0, 1, 2] + rx_port = [1, 2, 3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_add_004(self): - # rule 0 test - in_pcap_file = 'pipeline/and_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_004/add_004.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/add_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_004/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_add_005(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_005/add_005.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/add_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_005/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_and_006(self): + def test_add_006(self): - cli_file = '/tmp/pipeline/and_006/and_006.cli' + cli_file = '/tmp/pipeline/add_006/add_006.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/add_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_006/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_add_007(self): - # rule 0 test - in_pcap_file = 'pipeline/and_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_007/add_007.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/add_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_007/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_add_008(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/add_008/add_008.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/add_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/add_008/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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_and_007(self): + def test_shl_001(self): - cli_file = '/tmp/pipeline/and_007/and_007.cli' + cli_file = '/tmp/pipeline/shl_001/shl_001.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shl_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_shl_002(self): - # rule 0 test - in_pcap_file = 'pipeline/and_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_007/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shl_002/shl_002.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/shl_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_shl_003(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shl_003/shl_003.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/shl_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_003/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_and_008(self): + def test_shl_004(self): - cli_file = '/tmp/pipeline/and_008/and_008.cli' + cli_file = '/tmp/pipeline/shl_004/shl_004.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shl_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_004/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_shl_005(self): - # rule 0 test - in_pcap_file = 'pipeline/and_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/and_008/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shl_005/shl_005.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/shl_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_005/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_shl_006(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shl_006/shl_006.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/shl_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_006/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_or_001(self): + def test_shl_007(self): - cli_file = '/tmp/pipeline/or_001/or_001.cli' + cli_file = '/tmp/pipeline/shl_007/shl_007.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shl_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_007/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_shl_008(self): - # rule 0 test - in_pcap_file = 'pipeline/or_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shl_008/shl_008.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/shl_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shl_008/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_shr_001(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shr_001/shr_001.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/shr_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_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_or_002(self): + def test_shr_002(self): - cli_file = '/tmp/pipeline/or_002/or_002.cli' + cli_file = '/tmp/pipeline/shr_002/shr_002.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shr_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_shr_003(self): - # rule 0 test - in_pcap_file = 'pipeline/or_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shr_003/shr_003.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/shr_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_003/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_shr_004(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shr_004/shr_004.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/shr_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_004/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_or_003(self): + def test_shr_005(self): - cli_file = '/tmp/pipeline/or_003/or_003.cli' + cli_file = '/tmp/pipeline/shr_005/shr_005.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shr_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_005/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_shr_006(self): - # rule 0 test - in_pcap_file = 'pipeline/or_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shr_006/shr_006.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/shr_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_006/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_shr_007(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/shr_007/shr_007.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/shr_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_007/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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_or_004(self): + def test_shr_008(self): - cli_file = '/tmp/pipeline/or_004/or_004.cli' + cli_file = '/tmp/pipeline/shr_008/shr_008.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/shr_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/shr_008/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_sub_001(self): - # rule 0 test - in_pcap_file = 'pipeline/or_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_001/sub_001.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/sub_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_sub_002(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_002/sub_002.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/sub_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_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_or_005(self): + def test_sub_003(self): - cli_file = '/tmp/pipeline/or_005/or_005.cli' + cli_file = '/tmp/pipeline/sub_003/sub_003.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/sub_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_003/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_sub_004(self): - # rule 0 test - in_pcap_file = 'pipeline/or_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_004/sub_004.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/sub_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_004/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_sub_005(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_005/sub_005.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/sub_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_005/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_or_006(self): + def test_sub_006(self): - cli_file = '/tmp/pipeline/or_006/or_006.cli' + cli_file = '/tmp/pipeline/sub_006/sub_006.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/sub_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_006/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_sub_007(self): - # rule 0 test - in_pcap_file = 'pipeline/or_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_007/sub_007.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/sub_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_007/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_sub_008(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/sub_008/sub_008.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/sub_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/sub_008/pcap_files/out_1.txt'] * 4 + filters = ["udp"] * 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_or_007(self): + def test_mov_001(self): - cli_file = '/tmp/pipeline/or_007/or_007.cli' + cli_file = '/tmp/pipeline/mov_001/mov_001.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/mov_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_mov_002(self): - # rule 0 test - in_pcap_file = 'pipeline/or_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_007/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/mov_002/mov_002.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/mov_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_mov_003(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/mov_003/mov_003.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/mov_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_003/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_or_008(self): + def test_mov_004(self): - cli_file = '/tmp/pipeline/or_008/or_008.cli' + cli_file = '/tmp/pipeline/mov_004/mov_004.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/mov_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_004/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_mov_005(self): - # rule 0 test - in_pcap_file = 'pipeline/or_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/or_008/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/mov_005/mov_005.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = 'pipeline/mov_005/pcap_files/in_1.txt' + out_pcap = 'pipeline/mov_005/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(2, 0, in_pcap, out_pcap, "tcp") + self.send_and_sniff_pkts(3, 0, in_pcap, out_pcap, "tcp") + self.dut.send_expect("^C", "# ", 20) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 3, in_pcap_file, out_pcap_file, filters) + def test_mov_007(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/mov_007/mov_007.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/mov_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_007/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_xor_001(self): + def test_mov_008(self): - cli_file = '/tmp/pipeline/xor_001/xor_001.cli' + cli_file = '/tmp/pipeline/mov_008/mov_008.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/mov_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/mov_008/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_table_001(self): - # rule 0 test - in_pcap_file = 'pipeline/xor_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/table_001/table_001.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/table_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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 3, in_pcap_file, out_pcap_file, filters) + def test_vxlan_001(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 2, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/vxlan_001/vxlan_001.cli' + self.run_dpdk_app(cli_file) + + in_pcap_0 = 'pipeline/vxlan_001/pcap_files/in_1.txt' + in_pcap_1 = 'pipeline/vxlan_001/pcap_files/in_2.txt' + in_pcap_2 = 'pipeline/vxlan_001/pcap_files/in_3.txt' + in_pcap_3 = 'pipeline/vxlan_001/pcap_files/in_4.txt' + out_pcap_0 = 'pipeline/vxlan_001/pcap_files/out_1.txt' + out_pcap_1 = 'pipeline/vxlan_001/pcap_files/out_2.txt' + out_pcap_2 = 'pipeline/vxlan_001/pcap_files/out_3.txt' + out_pcap_3 = 'pipeline/vxlan_001/pcap_files/out_4.txt' + + in_pcap = [in_pcap_0, in_pcap_1, in_pcap_2, in_pcap_3] + out_pcap = [out_pcap_0, out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["udp"] * 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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + def test_dma_001(self): - def test_xor_002(self): + cli_file = '/tmp/pipeline/dma_001/dma_001.cli' + self.run_dpdk_app(cli_file) - cli_file = '/tmp/pipeline/xor_002/xor_002.cli' + in_pcap = ['pipeline/dma_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_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) - 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) + def test_dma_002(self): - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cli_file = '/tmp/pipeline/dma_002/dma_002.cli' + self.run_dpdk_app(cli_file) - # rule 0 test - in_pcap_file = 'pipeline/xor_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/dma_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + def test_dma_003(self): - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/dma_003/dma_003.cli' + self.run_dpdk_app(cli_file) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/dma_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_003/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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + def test_dma_004(self): - def test_xor_003(self): + cli_file = '/tmp/pipeline/dma_004/dma_004.cli' + self.run_dpdk_app(cli_file) - cli_file = '/tmp/pipeline/xor_003/xor_003.cli' + in_pcap = ['pipeline/dma_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_004/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) - 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) + def test_dma_005(self): - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cli_file = '/tmp/pipeline/dma_005/dma_005.cli' + self.run_dpdk_app(cli_file) - # rule 0 test - in_pcap_file = 'pipeline/xor_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/dma_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_005/pcap_files/out_1.txt'] * 4 + filters = ["vlan"] * 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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + def test_dma_006(self): - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/dma_006/dma_006.cli' + self.run_dpdk_app(cli_file) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/dma_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_006/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4532"] * 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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + def test_dma_007(self): - def test_xor_004(self): + cli_file = '/tmp/pipeline/dma_007/dma_007.cli' + self.run_dpdk_app(cli_file) - cli_file = '/tmp/pipeline/xor_004/xor_004.cli' + in_pcap = ['pipeline/dma_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_007/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4532"] * 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) - 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) + def test_dma_008(self): - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cli_file = '/tmp/pipeline/dma_008/dma_008.cli' + self.run_dpdk_app(cli_file) - # rule 0 test - in_pcap_file = 'pipeline/xor_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/dma_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/dma_008/pcap_files/out_1.txt'] * 4 + filters = ["udp port 4532"] * 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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + def test_jump_001(self): - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_001/jump_001.cli' + self.run_dpdk_app(cli_file) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + def test_jump_002(self): - def test_xor_005(self): + cli_file = '/tmp/pipeline/jump_002/jump_002.cli' + self.run_dpdk_app(cli_file) - cli_file = '/tmp/pipeline/xor_005/xor_005.cli' + in_pcap = ['pipeline/jump_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_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) - 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) + def test_jump_003(self): - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cli_file = '/tmp/pipeline/jump_003/jump_003.cli' + self.run_dpdk_app(cli_file) - # rule 0 test - in_pcap_file = 'pipeline/xor_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_003/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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + def test_jump_004(self): - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_004/jump_004.cli' + self.run_dpdk_app(cli_file) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_004/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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + def test_jump_005(self): - def test_xor_006(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ + cli_file = '/tmp/pipeline/jump_005/jump_005.cli' + self.run_dpdk_app(cli_file) - cli_file = '/tmp/pipeline/xor_006/xor_006.cli' + in_pcap = ['pipeline/jump_005/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_005/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) - 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) + def test_jump_006(self): - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + cli_file = '/tmp/pipeline/jump_006/jump_006.cli' + self.run_dpdk_app(cli_file) - in_pcap_file = 'pipeline/xor_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_006/pcap_files/out_1.txt' - filters = "tcp" + in_pcap = ['pipeline/jump_006/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_006/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) - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 1, in_pcap_file, out_pcap_file, filters) + def test_jump_007(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_007/jump_007.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 3, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_007/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_007/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 2, in_pcap_file, out_pcap_file, filters) + def test_jump_008(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_008/jump_008.cli' + self.run_dpdk_app(cli_file) - def test_xor_007(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ + in_pcap = ['pipeline/jump_008/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_008/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) - cli_file = '/tmp/pipeline/xor_007/xor_007.cli' + def test_jump_009(self): - 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) + cli_file = '/tmp/pipeline/jump_009/jump_009.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_009/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_009/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) - in_pcap_file = 'pipeline/xor_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_007/pcap_files/out_1.txt' - filters = "tcp" + def test_jump_010(self): - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_010/jump_010.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_010/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_010/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_jump_011(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_011/jump_011.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/jump_011/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_011/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_xor_008(self): + def test_jump_012(self): - cli_file = '/tmp/pipeline/xor_008/xor_008.cli' + cli_file = '/tmp/pipeline/jump_012/jump_012.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/jump_012/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_012/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_jump_013(self): - # rule 0 test - in_pcap_file = 'pipeline/xor_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/xor_008/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_013/jump_013.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_013/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_013/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_jump_014(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_014/jump_014.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/jump_014/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_014/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_add_001(self): + def test_jump_015(self): - cli_file = '/tmp/pipeline/add_001/add_001.cli' + cli_file = '/tmp/pipeline/jump_015/jump_015.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/jump_015/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_015/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_jump_016(self): - # rule 0 test - in_pcap_file = 'pipeline/add_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_016/jump_016.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_016/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_016/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_jump_017(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_017/jump_017.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/jump_017/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_017/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_add_002(self): + def test_jump_018(self): - cli_file = '/tmp/pipeline/add_002/add_002.cli' + cli_file = '/tmp/pipeline/jump_018/jump_018.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/jump_018/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_018/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_jump_019(self): - # rule 0 test - in_pcap_file = 'pipeline/add_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_019/jump_019.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_019/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_019/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_jump_020(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_020/jump_020.cli' + self.run_dpdk_app(cli_file) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = ['pipeline/jump_020/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_020/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_add_003(self): + def test_jump_021(self): - cli_file = '/tmp/pipeline/add_003/add_003.cli' + cli_file = '/tmp/pipeline/jump_021/jump_021.cli' + self.run_dpdk_app(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) + in_pcap = ['pipeline/jump_021/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_021/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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_jump_022(self): - # rule 0 test - in_pcap_file = 'pipeline/add_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_022/jump_022.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_022/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_022/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_023(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_023/jump_023.cli' + self.run_dpdk_app(cli_file) - def test_add_004(self): + in_pcap = ['pipeline/jump_023/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_023/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) - cli_file = '/tmp/pipeline/add_004/add_004.cli' + def test_jump_024(self): - 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) + cli_file = '/tmp/pipeline/jump_024/jump_024.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_024/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_024/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) - # rule 0 test - in_pcap_file = 'pipeline/add_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_025(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_025/jump_025.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_025/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_025/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_026(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_026/jump_026.cli' + self.run_dpdk_app(cli_file) - def test_add_005(self): + in_pcap = ['pipeline/jump_026/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_026/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) - cli_file = '/tmp/pipeline/add_005/add_005.cli' + def test_jump_027(self): - 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) + cli_file = '/tmp/pipeline/jump_027/jump_027.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_027/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_027/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) - # rule 0 test - in_pcap_file = 'pipeline/add_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_028(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_028/jump_028.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_028/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_028/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_029(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_029/jump_029.cli' + self.run_dpdk_app(cli_file) - def test_add_006(self): + in_pcap = ['pipeline/jump_029/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_029/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) - cli_file = '/tmp/pipeline/add_006/add_006.cli' + def test_jump_030(self): - 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) + cli_file = '/tmp/pipeline/jump_030/jump_030.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_030/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_030/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) - # rule 0 test - in_pcap_file = 'pipeline/add_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_031(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_031/jump_031.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_031/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_031/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_032(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_032/jump_032.cli' + self.run_dpdk_app(cli_file) - def test_add_007(self): + in_pcap = ['pipeline/jump_032/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_032/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) - cli_file = '/tmp/pipeline/add_007/add_007.cli' + def test_jump_033(self): - 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) + cli_file = '/tmp/pipeline/jump_033/jump_033.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_033/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_033/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) - # rule 0 test - in_pcap_file = 'pipeline/add_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_007/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_034(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_034/jump_034.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_034/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_034/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_035(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_035/jump_035.cli' + self.run_dpdk_app(cli_file) - def test_add_008(self): + in_pcap = ['pipeline/jump_035/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_035/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) - cli_file = '/tmp/pipeline/add_008/add_008.cli' + def test_jump_036(self): - 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) + cli_file = '/tmp/pipeline/jump_036/jump_036.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_036/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_036/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) - # rule 0 test - in_pcap_file = 'pipeline/add_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/add_008/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_037(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_037/jump_037.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_037/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_037/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_038(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_038/jump_038.cli' + self.run_dpdk_app(cli_file) - def test_shl_001(self): + in_pcap = ['pipeline/jump_038/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_038/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) - cli_file = '/tmp/pipeline/shl_001/shl_001.cli' + def test_jump_039(self): - 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) + cli_file = '/tmp/pipeline/jump_039/jump_039.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_039/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_039/pcap_files/out_1.txt'] * 4 + filters = [""] * 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) - # rule 0 test - in_pcap_file = 'pipeline/shl_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_040(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_040/jump_040.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_040/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_040/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_041(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_041/jump_041.cli' + self.run_dpdk_app(cli_file) - def test_shl_002(self): + in_pcap = ['pipeline/jump_041/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_041/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) - cli_file = '/tmp/pipeline/shl_002/shl_002.cli' + def test_jump_042(self): - 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) + cli_file = '/tmp/pipeline/jump_042/jump_042.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_042/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_042/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_043(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_043/jump_043.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_043/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_043/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_044(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_044/jump_044.cli' + self.run_dpdk_app(cli_file) - def test_shl_003(self): + in_pcap = ['pipeline/jump_044/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_044/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) - cli_file = '/tmp/pipeline/shl_003/shl_003.cli' + def test_jump_045(self): - 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) + cli_file = '/tmp/pipeline/jump_045/jump_045.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_045/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_045/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_046(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_046/jump_046.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_046/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_046/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_047(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_047/jump_047.cli' + self.run_dpdk_app(cli_file) - def test_shl_004(self): + in_pcap = ['pipeline/jump_047/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_047/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) - cli_file = '/tmp/pipeline/shl_004/shl_004.cli' + def test_jump_048(self): - 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) + cli_file = '/tmp/pipeline/jump_048/jump_048.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_048/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_048/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_049(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_049/jump_049.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_049/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_049/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_050(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_050/jump_050.cli' + self.run_dpdk_app(cli_file) - def test_shl_005(self): + in_pcap = ['pipeline/jump_050/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_050/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) - cli_file = '/tmp/pipeline/shl_005/shl_005.cli' + def test_jump_051(self): - 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) + cli_file = '/tmp/pipeline/jump_051/jump_051.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_051/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_051/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_052(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_052/jump_052.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_052/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_052/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_jump_053(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/jump_053/jump_053.cli' + self.run_dpdk_app(cli_file) - def test_shl_006(self): + in_pcap = ['pipeline/jump_053/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_053/pcap_files/out_1.txt'] * 4 + filters = [""] * 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) - cli_file = '/tmp/pipeline/shl_006/shl_006.cli' + def test_jump_054(self): - 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) + cli_file = '/tmp/pipeline/jump_054/jump_054.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/jump_054/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_054/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_jump_055(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/jump_055/jump_055.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/jump_055/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/jump_055/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_ckadd_001(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/ckadd_001/ckadd_001.cli' + self.run_dpdk_app(cli_file) - def test_shl_007(self): + in_pcap = ['pipeline/ckadd_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/ckadd_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) - cli_file = '/tmp/pipeline/shl_007/shl_007.cli' + def test_ckadd_009(self): - 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) + cli_file = '/tmp/pipeline/ckadd_009/ckadd_009.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/ckadd_009/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/ckadd_009/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) - # rule 0 test - in_pcap_file = 'pipeline/shl_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_007/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_ckadd_010(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/ckadd_010/ckadd_010.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/ckadd_010/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/ckadd_010/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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_cksub_001(self): - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + cli_file = '/tmp/pipeline/cksub_001/cksub_001.cli' + self.run_dpdk_app(cli_file) - def test_shl_008(self): + in_pcap = ['pipeline/cksub_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/cksub_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) - cli_file = '/tmp/pipeline/shl_008/shl_008.cli' + def test_invalidate_001(self): - 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) + cli_file = '/tmp/pipeline/invalidate_001/invalidate_001.cli' + self.run_dpdk_app(cli_file) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/invalidate_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/invalidate_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) - # rule 0 test - in_pcap_file = 'pipeline/shl_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shl_008/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + def test_validate_001(self): - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/validate_001/validate_001.cli' + self.run_dpdk_app(cli_file) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/validate_001/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/validate_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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_table_002(self): + cli_file = '/tmp/pipeline/table_002/table_002.cli' + self.run_dpdk_app(cli_file) sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s = self.connect_cli_server() - def test_shr_001(self): + # empty table scenario + in_pcap = ['pipeline/table_002/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/table_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) - cli_file = '/tmp/pipeline/shr_001/shr_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/shr_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + # single rule scenario + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - def test_shr_002(self): + in_pcap = ['pipeline/table_002/pcap_files/in_2.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_2.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) - cli_file = '/tmp/pipeline/shr_002/shr_002.cli' + # two rules scenario + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_3.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - 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) + in_pcap = ['pipeline/table_002/pcap_files/in_3.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_3.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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + # delete one rule scenario + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_4_1.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/shr_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_002/pcap_files/in_4_1.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_4_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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + # delete all rules scenario + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_4_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_002/pcap_files/in_4_2.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_4_2.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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + # action update scenario (restore one of the previously deleted rules and check the update) + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_5_1.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = 'pipeline/table_002/pcap_files/in_5_1.txt' + out_pcap = 'pipeline/table_002/pcap_files/out_5_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "tcp") - def test_shr_003(self): + # action update scenario (change the action of restored rule and check the update) + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_5_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - cli_file = '/tmp/pipeline/shr_003/shr_003.cli' + in_pcap = ['pipeline/table_002/pcap_files/in_5_1.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_5_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) - 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) + # deafult action scenario [empty table] + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_6_1.txt' # delete the previously added rule + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + in_pcap = ['pipeline/table_002/pcap_files/in_6_1.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_6_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) - # rule 0 test - in_pcap_file = 'pipeline/shr_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + # deafult action scenario [table with one rule] + ''' + Add key A => Lookup HIT for the right packet with the specific key associated action executed + Lookup MISS for any other packets with default action executed + ''' + CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_6_2.txt' # add a new rule + CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_002/pcap_files/in_6_2.txt'] * 4 + out_pcap = ['pipeline/table_002/pcap_files/out_6_2.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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + def test_table_003(self): + cli_file = '/tmp/pipeline/table_003/table_003.cli' + self.run_dpdk_app(cli_file) sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_shr_004(self): - - cli_file = '/tmp/pipeline/shr_004/shr_004.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/shr_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s = self.connect_cli_server() - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + # Empty table scenario + in_pcap = ['pipeline/table_003/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/table_003/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) - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + # Single rule scenario + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - def test_shr_005(self): + in_pcap = ['pipeline/table_003/pcap_files/in_2.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_2.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) - cli_file = '/tmp/pipeline/shr_005/shr_005.cli' + # test two rules scenario + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_3.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - 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) + in_pcap = ['pipeline/table_003/pcap_files/in_3.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_3.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) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + # delete one rule scenario + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_4_1.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update none {} none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/shr_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_003/pcap_files/in_4_1.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_4_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) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + # delete all rules scenario + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_4_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update none {} none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_003/pcap_files/in_4_2.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_4_2.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) - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + # action update scenario (restore one of the previously deleted rules and check the update) + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_5_1.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + in_pcap = 'pipeline/table_003/pcap_files/in_5_1.txt' + out_pcap = 'pipeline/table_003/pcap_files/out_5_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "tcp") - def test_shr_006(self): + # action update scenario (change the action of restored rule and check the update) + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_5_2.txt' + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + in_pcap = ['pipeline/table_003/pcap_files/in_5_1.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_5_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) + + # Default action scenario [Empty table] + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_6_1_1.txt' # delete the previously added rule + CMD_FILE_2 = '/tmp/pipeline/table_003/cmd_files/cmd_6_1_2.txt' # change the default action of table + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update none {} {} \n'.format(CMD_FILE, CMD_FILE_2) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + in_pcap = ['pipeline/table_003/pcap_files/in_6_1.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_6_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) + + # Default action scenario [Table with one rule] + ''' + Add key A => Lookup HIT for the right packet with the specific key associated action executed + Lookup MISS for any other packets with default action executed + ''' + CMD_FILE = '/tmp/pipeline/table_003/cmd_files/cmd_6_2.txt' # add a new rule + CLI_CMD = 'pipeline PIPELINE0 table table_003_table update {} none none\n'.format(CMD_FILE) + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - cli_file = '/tmp/pipeline/shr_006/shr_006.cli' + in_pcap = ['pipeline/table_003/pcap_files/in_6_2.txt'] * 4 + out_pcap = ['pipeline/table_003/pcap_files/out_6_2.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) - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + def test_table_004(self): - # rule 0 test - in_pcap_file = 'pipeline/shr_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/table_004/table_004.cli' + self.run_dpdk_app(cli_file) - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + in_pcap = ['pipeline/table_004/pcap_files/in_1.txt'] * 4 + out_pcap = ['pipeline/table_004/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) - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + def test_reg_001(self): - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + cli_file = '/tmp/pipeline/reg_001/reg_001.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + # Read default initial value + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x0\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - def test_shr_007(self): + # Update the register array location + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x0 0xab\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") - cli_file = '/tmp/pipeline/shr_007/shr_007.cli' + # Verify updated value + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x0\n' + self.socket_send_cmd(s, CLI_CMD, "0xab\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_002(self): + + cli_file = '/tmp/pipeline/reg_002/reg_002.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + s.close() - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + # Read updated values through packet + in_pcap_file = 'pipeline/reg_002/pcap_files/in_1.txt' + out_pcap_file = 'pipeline/reg_002/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, "tcp") + self.dut.send_expect("^C", "# ", 20) + + def test_reg_003(self): + + cli_file = '/tmp/pipeline/reg_003/reg_003.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + s.close() - # rule 0 test - in_pcap_file = 'pipeline/shr_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_007/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + # Read updated values through packet + in_pcap_file = 'pipeline/reg_003/pcap_files/in_1.txt' + out_pcap_file = 'pipeline/reg_003/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, "tcp") + self.dut.send_expect("^C", "# ", 20) + + def test_reg_004(self): + + cli_file = '/tmp/pipeline/reg_004/reg_004.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + s.close() - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + # Read updated values through packet + in_pcap_file = 'pipeline/reg_004/pcap_files/in_1.txt' + out_pcap_file = 'pipeline/reg_004/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, "tcp") + self.dut.send_expect("^C", "# ", 20) + + def test_reg_005(self): + + cli_file = '/tmp/pipeline/reg_005/reg_005.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + s.close() - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + # Read updated values through packet + in_pcap_file = 'pipeline/reg_005/pcap_files/in_1.txt' + out_pcap_file = 'pipeline/reg_005/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, "tcp") + self.dut.send_expect("^C", "# ", 20) + + def test_reg_006(self): + + cli_file = '/tmp/pipeline/reg_006/reg_006.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send a packet to trigger the execution of apply block + in_pcap_file = 'pipeline/reg_006/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify written vs read values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa3a4\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb3b4\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_007(self): + + cli_file = '/tmp/pipeline/reg_007/reg_007.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send a packet to trigger the execution of apply block + in_pcap_file = 'pipeline/reg_007/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify written vs read values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa3a4\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb3b4\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_008(self): + + cli_file = '/tmp/pipeline/reg_008/reg_008.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send a packet to trigger the execution of apply block + in_pcap_file = 'pipeline/reg_008/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify written vs read values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa3a4\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb3b4\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - def test_shr_008(self): + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_009(self): + + cli_file = '/tmp/pipeline/reg_009/reg_009.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0x123456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0x12345678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0x1234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0x12\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send a packet to trigger the execution of apply block + in_pcap_file = 'pipeline/reg_009/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify written vs read values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa3a4\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb3b4\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - cli_file = '/tmp/pipeline/shr_008/shr_008.cli' + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_010(self): + + cli_file = '/tmp/pipeline/reg_010/reg_010.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_010/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_011(self): + + cli_file = '/tmp/pipeline/reg_011/reg_011.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_011/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_012(self): + + cli_file = '/tmp/pipeline/reg_012/reg_012.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_012/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/shr_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/shr_008/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_013(self): + + cli_file = '/tmp/pipeline/reg_013/reg_013.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x06\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_013/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x06\n' + self.socket_send_cmd(s, CLI_CMD, "0x9876543210987654\npipeline> ") - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_014(self): + + cli_file = '/tmp/pipeline/reg_014/reg_014.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_014/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_015(self): + + cli_file = '/tmp/pipeline/reg_015/reg_015.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_015/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_016(self): + + cli_file = '/tmp/pipeline/reg_016/reg_016.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_016/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_017(self): + + cli_file = '/tmp/pipeline/reg_017/reg_017.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_017/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - def test_sub_001(self): + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_018(self): + + cli_file = '/tmp/pipeline/reg_018/reg_018.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_018/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - cli_file = '/tmp/pipeline/sub_001/sub_001.cli' + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_019(self): + + cli_file = '/tmp/pipeline/reg_019/reg_019.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_019/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_020(self): + + cli_file = '/tmp/pipeline/reg_020/reg_020.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_020/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_021(self): + + cli_file = '/tmp/pipeline/reg_021/reg_021.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_021/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/sub_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_022(self): + + cli_file = '/tmp/pipeline/reg_022/reg_022.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_022/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x6\npipeline> ") - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_023(self): + + cli_file = '/tmp/pipeline/reg_023/reg_023.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_023/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_024(self): + + cli_file = '/tmp/pipeline/reg_024/reg_024.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_024/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x12\npipeline> ") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_025(self): + + cli_file = '/tmp/pipeline/reg_025/reg_025.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Verify the default initial values of zero + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x0\npipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_025/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234567890123456\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x123456789012\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345678\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0x1234\npipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_026(self): + + cli_file = '/tmp/pipeline/reg_026/reg_026.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_026/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - def test_sub_002(self): + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_027(self): + + cli_file = '/tmp/pipeline/reg_027/reg_027.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_027/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - cli_file = '/tmp/pipeline/sub_002/sub_002.cli' + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_028(self): + + cli_file = '/tmp/pipeline/reg_028/reg_028.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_028/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_029(self): + + cli_file = '/tmp/pipeline/reg_029/reg_029.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_029/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_030(self): + + cli_file = '/tmp/pipeline/reg_030/reg_030.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_030/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/sub_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_031(self): + + cli_file = '/tmp/pipeline/reg_031/reg_031.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_031/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_032(self): + + cli_file = '/tmp/pipeline/reg_032/reg_032.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_032/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_033(self): + + cli_file = '/tmp/pipeline/reg_033/reg_033.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_033/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_034(self): + + cli_file = '/tmp/pipeline/reg_034/reg_034.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_034/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_035(self): + + cli_file = '/tmp/pipeline/reg_035/reg_035.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_035/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - def test_sub_003(self): + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_036(self): + + cli_file = '/tmp/pipeline/reg_036/reg_036.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_036/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - cli_file = '/tmp/pipeline/sub_003/sub_003.cli' + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_037(self): + + cli_file = '/tmp/pipeline/reg_037/reg_037.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_037/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - 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) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_038(self): + + cli_file = '/tmp/pipeline/reg_038/reg_038.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_038/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file) - self.dut.send_expect(cmd, "PIPELINE0 enable", 60) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_039(self): + + cli_file = '/tmp/pipeline/reg_039/reg_039.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_039/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - # rule 0 test - in_pcap_file = 'pipeline/sub_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_040(self): + + cli_file = '/tmp/pipeline/reg_040/reg_040.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_040/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_041(self): + + cli_file = '/tmp/pipeline/reg_041/reg_041.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xf7 0x1f\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_041/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Update the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ace68ac468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x12345777e68a\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x124448ac\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0x10f1\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xf7\n' + self.socket_send_cmd(s, CLI_CMD, "0x25\npipeline> ") - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_042(self): + + cli_file = '/tmp/pipeline/reg_042/reg_042.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_042/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_043(self): + + cli_file = '/tmp/pipeline/reg_043/reg_043.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_043/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_044(self): + + cli_file = '/tmp/pipeline/reg_044/reg_044.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x1a1a2a3 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7fc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0x7f 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_044/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x1a1a2a3\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7fc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0x7f\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - def test_sub_004(self): + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_reg_045(self): + + cli_file = '/tmp/pipeline/reg_045/reg_045.cli' + self.run_dpdk_app(cli_file) + sleep(CLI_SERVER_CONNECT_DELAY) + s = self.connect_cli_server() + + # Initialize the register array locations with required values + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xa1a2 0xff23456789012\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xb1b2 0xff5678\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xc1 0xff234\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regwr REG_ARR_1 0xd1 0xff2\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + # Send packet to DUT to update the register array + in_pcap_file = 'pipeline/reg_045/pcap_files/in_1.txt' + self.send_pkts(0, 0, in_pcap_file) + + # Verify whether the register array is updated with required values + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xa1a2\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468acf12024\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xb1b2\n' + self.socket_send_cmd(s, CLI_CMD, "0x1333acf0\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xc1\n' + self.socket_send_cmd(s, CLI_CMD, "0x100468\npipeline> ") + CLI_CMD = 'pipeline PIPELINE0 regrd REG_ARR_1 0xd1\n' + self.socket_send_cmd(s, CLI_CMD, "0xff8\npipeline> ") - cli_file = '/tmp/pipeline/sub_004/sub_004.cli' + s.close() + self.dut.send_expect("^C", "# ", 20) + + def test_met_001(self): + + cli_file = '/tmp/pipeline/met_001/met_001.cli' + self.run_dpdk_app(cli_file) + + # Platinum Profile with High Packet Transmission Rate + in_pcap = ['pipeline/met_001/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_001/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_001/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_001/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + # Platinum Profile with Low Packet Transmission Rate + out_pcap_1 = 'pipeline/met_001/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_001/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_001/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + + # Gold Profile with High Packet Transmission Rate + s = self.connect_cli_server() + CLI_CMD = 'pipeline PIPELINE0 meter profile gold add cir 460 pir 1380 cbs 100 pbs 150\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 meter MET_ARRAY_1 from 0 to 0 set profile gold\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + CLI_CMD = 'pipeline PIPELINE0 meter profile platinum delete\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + + out_pcap_1 = 'pipeline/met_001/pcap_files/out_31.txt' + out_pcap_2 = 'pipeline/met_001/pcap_files/out_32.txt' + out_pcap_3 = 'pipeline/met_001/pcap_files/out_33.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + # Default Profile with High Packet Transmission Rate + CLI_CMD = 'pipeline PIPELINE0 meter MET_ARRAY_1 from 0 to 0 reset\n' + self.socket_send_cmd(s, CLI_CMD, "pipeline> ") + s.close() - 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) - - # rule 0 test - in_pcap_file = 'pipeline/sub_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_sub_005(self): - - cli_file = '/tmp/pipeline/sub_005/sub_005.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/sub_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_sub_006(self): - - cli_file = '/tmp/pipeline/sub_006/sub_006.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/sub_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_sub_007(self): - - cli_file = '/tmp/pipeline/sub_007/sub_007.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/sub_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_007/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_sub_008(self): - - cli_file = '/tmp/pipeline/sub_008/sub_008.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/sub_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/sub_008/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_001(self): - - cli_file = '/tmp/pipeline/mov_001/mov_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/mov_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_002(self): - """ - mov_002: swap destination and source MAC address of packets received on port - """ - cli_file = '/tmp/pipeline/mov_002/mov_002.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/mov_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_003(self): - - cli_file = '/tmp/pipeline/mov_003/mov_003.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/mov_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_004(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ - - cli_file = '/tmp/pipeline/mov_004/mov_004.cli' - - 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) - - in_pcap_file = 'pipeline/mov_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_004/pcap_files/out_1.txt' - filters = "tcp" - - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_005(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ - - cli_file = '/tmp/pipeline/mov_005/mov_005.cli' - - 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) - - in_pcap_file = 'pipeline/mov_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_005/pcap_files/out_1.txt' - filters = "tcp" - - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 0, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 0, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_007(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ - - cli_file = '/tmp/pipeline/mov_007/mov_007.cli' - - 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) - - in_pcap_file = 'pipeline/mov_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_007/pcap_files/out_1.txt' - filters = "tcp" - - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 0, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 0, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_mov_008(self): - """ - find entry in the table based on the des mac address, - then update the src mac address to the mac address in the table. - """ - - cli_file = '/tmp/pipeline/mov_008/mov_008.cli' - - 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) - - in_pcap_file = 'pipeline/mov_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/mov_008/pcap_files/out_1.txt' - filters = "tcp" - - # rule 0 test - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_table_001(self): - - cli_file = '/tmp/pipeline/table_001/table_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/table_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/table_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_vxlan_001(self): - """ - example application: vxlan pipeline - """ - cli_file = '/tmp/pipeline/vxlan_001/vxlan_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/vxlan_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/vxlan_001/pcap_files/out_1.txt' - filters = "udp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - in_pcap_file = 'pipeline/vxlan_001/pcap_files/in_2.txt' - out_pcap_file = 'pipeline/vxlan_001/pcap_files/out_2.txt' - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - in_pcap_file = 'pipeline/vxlan_001/pcap_files/in_3.txt' - out_pcap_file = 'pipeline/vxlan_001/pcap_files/out_3.txt' - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - in_pcap_file = 'pipeline/vxlan_001/pcap_files/in_4.txt' - out_pcap_file = 'pipeline/vxlan_001/pcap_files/out_4.txt' - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_001(self): - """ - example application: vxlan pipeline - """ - cli_file = '/tmp/pipeline/dma_001/dma_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_002(self): - - cli_file = '/tmp/pipeline/dma_002/dma_002.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_003(self): - - cli_file = '/tmp/pipeline/dma_003/dma_003.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_004(self): - - cli_file = '/tmp/pipeline/dma_004/dma_004.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_005(self): - - cli_file = '/tmp/pipeline/dma_005/dma_005.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_005/pcap_files/out_1.txt' - filters = "vlan" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_006(self): - - cli_file = '/tmp/pipeline/dma_006/dma_006.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_006/pcap_files/out_1.txt' - filters = "udp port 4532" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_007(self): - - cli_file = '/tmp/pipeline/dma_007/dma_007.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_007/pcap_files/out_1.txt' - filters = "udp port 4532" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_dma_008(self): - - cli_file = '/tmp/pipeline/dma_008/dma_008.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/dma_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/dma_008/pcap_files/out_1.txt' - filters = "udp port 4532" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_001(self): - - cli_file = '/tmp/pipeline/jump_001/jump_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_002(self): - - cli_file = '/tmp/pipeline/jump_002/jump_002.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_003(self): - - cli_file = '/tmp/pipeline/jump_003/jump_003.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_003/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_003/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_004(self): - - cli_file = '/tmp/pipeline/jump_004/jump_004.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_004/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_004/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_005(self): - - cli_file = '/tmp/pipeline/jump_005/jump_005.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_005/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_005/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_006(self): - - cli_file = '/tmp/pipeline/jump_006/jump_006.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_006/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_006/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_007(self): - - cli_file = '/tmp/pipeline/jump_007/jump_007.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_007/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_007/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_008(self): - - cli_file = '/tmp/pipeline/jump_008/jump_008.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_008/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_008/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_009(self): - - cli_file = '/tmp/pipeline/jump_009/jump_009.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_009/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_009/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_010(self): - - cli_file = '/tmp/pipeline/jump_010/jump_010.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_010/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_010/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_011(self): - - cli_file = '/tmp/pipeline/jump_011/jump_011.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_011/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_011/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_012(self): - - cli_file = '/tmp/pipeline/jump_012/jump_012.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_012/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_012/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_013(self): - - cli_file = '/tmp/pipeline/jump_013/jump_013.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_013/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_013/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_014(self): - - cli_file = '/tmp/pipeline/jump_014/jump_014.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_014/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_014/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_015(self): - - cli_file = '/tmp/pipeline/jump_015/jump_015.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_015/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_015/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_016(self): - - cli_file = '/tmp/pipeline/jump_016/jump_016.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_016/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_016/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_017(self): - - cli_file = '/tmp/pipeline/jump_017/jump_017.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_017/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_017/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_018(self): - - cli_file = '/tmp/pipeline/jump_018/jump_018.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_018/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_018/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_019(self): - - cli_file = '/tmp/pipeline/jump_019/jump_019.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_019/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_019/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_020(self): - - cli_file = '/tmp/pipeline/jump_020/jump_020.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_020/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_020/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_021(self): - - cli_file = '/tmp/pipeline/jump_021/jump_021.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_021/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_021/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_022(self): - - cli_file = '/tmp/pipeline/jump_022/jump_022.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_022/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_022/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_023(self): - - cli_file = '/tmp/pipeline/jump_023/jump_023.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_023/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_023/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_024(self): - - cli_file = '/tmp/pipeline/jump_024/jump_024.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_024/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_024/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_025(self): - - cli_file = '/tmp/pipeline/jump_025/jump_025.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_025/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_025/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_026(self): - - cli_file = '/tmp/pipeline/jump_026/jump_026.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_026/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_026/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_027(self): - - cli_file = '/tmp/pipeline/jump_027/jump_027.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_027/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_027/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_028(self): - - cli_file = '/tmp/pipeline/jump_028/jump_028.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_028/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_028/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_029(self): - - cli_file = '/tmp/pipeline/jump_029/jump_029.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_029/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_029/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_030(self): - - cli_file = '/tmp/pipeline/jump_030/jump_030.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_030/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_030/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_031(self): - - cli_file = '/tmp/pipeline/jump_031/jump_031.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_031/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_031/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_032(self): - - cli_file = '/tmp/pipeline/jump_032/jump_032.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_032/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_032/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_033(self): - - cli_file = '/tmp/pipeline/jump_033/jump_033.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_033/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_033/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_034(self): - - cli_file = '/tmp/pipeline/jump_034/jump_034.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_034/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_034/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_035(self): - - cli_file = '/tmp/pipeline/jump_035/jump_035.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_035/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_035/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_036(self): - - cli_file = '/tmp/pipeline/jump_036/jump_036.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_036/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_036/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_037(self): - - cli_file = '/tmp/pipeline/jump_037/jump_037.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_037/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_037/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_038(self): - - cli_file = '/tmp/pipeline/jump_038/jump_038.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_038/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_038/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_039(self): - - cli_file = '/tmp/pipeline/jump_039/jump_039.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_039/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_039/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_040(self): - - cli_file = '/tmp/pipeline/jump_040/jump_040.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_040/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_040/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_041(self): - - cli_file = '/tmp/pipeline/jump_041/jump_041.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_041/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_041/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_042(self): - - cli_file = '/tmp/pipeline/jump_042/jump_042.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_042/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_042/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_043(self): - - cli_file = '/tmp/pipeline/jump_043/jump_043.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_043/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_043/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_044(self): - - cli_file = '/tmp/pipeline/jump_044/jump_044.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_044/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_044/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_045(self): - - cli_file = '/tmp/pipeline/jump_045/jump_045.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_045/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_045/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_046(self): - - cli_file = '/tmp/pipeline/jump_046/jump_046.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_046/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_046/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_047(self): - - cli_file = '/tmp/pipeline/jump_047/jump_047.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_047/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_047/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_048(self): - - cli_file = '/tmp/pipeline/jump_048/jump_048.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_048/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_048/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_049(self): - - cli_file = '/tmp/pipeline/jump_049/jump_049.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_049/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_049/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_050(self): - - cli_file = '/tmp/pipeline/jump_050/jump_050.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_050/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_050/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_051(self): - - cli_file = '/tmp/pipeline/jump_051/jump_051.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_051/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_051/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_052(self): - - cli_file = '/tmp/pipeline/jump_052/jump_052.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_052/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_052/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_053(self): - - cli_file = '/tmp/pipeline/jump_053/jump_053.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_053/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_053/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_054(self): - - cli_file = '/tmp/pipeline/jump_054/jump_054.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_054/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_054/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_jump_055(self): - - cli_file = '/tmp/pipeline/jump_055/jump_055.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/jump_055/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/jump_055/pcap_files/out_1.txt' - filters = "" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_ckadd_001(self): - - cli_file = '/tmp/pipeline/ckadd_001/ckadd_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/ckadd_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/ckadd_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_ckadd_009(self): - - cli_file = '/tmp/pipeline/ckadd_009/ckadd_009.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/ckadd_009/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/ckadd_009/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_ckadd_010(self): - - cli_file = '/tmp/pipeline/ckadd_010/ckadd_010.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/ckadd_010/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/ckadd_010/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_cksub_001(self): - - cli_file = '/tmp/pipeline/cksub_001/cksub_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/cksub_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/cksub_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_invalidate_001(self): - - cli_file = '/tmp/pipeline/invalidate_001/invalidate_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/invalidate_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/invalidate_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_validate_001(self): - - cli_file = '/tmp/pipeline/validate_001/validate_001.cli' - - 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) - - # rule 0 test - in_pcap_file = 'pipeline/validate_001/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/validate_001/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # rule 1 test - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - - # rule 2 test - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - - # rule 3 test - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) - - def test_table_002(self): - - cli_file = '/tmp/pipeline/table_002/table_002.cli' - - 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) - - sleep(2) - - # create TCP connection to the server - SERVER_IP = '192.168.122.216' - SERVER_PORT = 8086 - BUFFER_SIZE = 1024 - - try: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - except socket.error as err: - print("socket creation failed with error %s" % (err)) - - try: - s.connect((SERVER_IP, SERVER_PORT)) - except socket.error as err: - print("socket connection failed with error %s" % (err)) - - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - # print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - - # test empty table scenario - in_pcap_file = 'pipeline/table_002/pcap_files/in_1.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_1.txt' - filters = "tcp" - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # test single rule scenario - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_2.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - # print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_2.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_2.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # test two rules scenario - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_3.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - # print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_3.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_3.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # delete one rule scenario - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_4_1.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - # print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_4_1.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_4_1.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # delete all rules scenario - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_4_2.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - # print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_4_2.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_4_2.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # action update scenario (restore one of the previously deleted rules and check the update) - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_5_1.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_5_1.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_5_1.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - - # action update scenario (change the action of restored rule and check the update) - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_5_2.txt' - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_5_1.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_5_1.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 3, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 2, in_pcap_file, out_pcap_file, filters) - - # deafult action scenario [empty table] - ''' - Empty table => Lookup MISS with default action executed - ''' - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_6_1.txt' # delete the previously added rule - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update none {} none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_6_1.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_6_1.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - # deafult action scenario [table with one rule] - ''' - Add key A => Lookup HIT for the right packet with the specific key associated action executed - Lookup MISS for any other packets with default action executed - ''' - CMD_FILE = '/tmp/pipeline/table_002/cmd_files/cmd_6_2.txt' # add a new rule - CLI_CMD = 'pipeline PIPELINE0 table table_002_table update {} none none\n'.format(CMD_FILE) - s.send(CLI_CMD.encode('utf-8')) - sleep(0.1) - msg = s.recv(BUFFER_SIZE) - response = msg.decode() - print('Rxd: ' + response) - if "pipeline>" not in response: - s.close() - self.verify(0, "CLI response error") - filters = "tcp" - in_pcap_file = 'pipeline/table_002/pcap_files/in_6_2.txt' - out_pcap_file = 'pipeline/table_002/pcap_files/out_6_2.txt' - sniff_pkts = self.send_and_sniff_pkts(0, 0, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(1, 1, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(2, 2, in_pcap_file, out_pcap_file, filters) - sniff_pkts = self.send_and_sniff_pkts(3, 3, in_pcap_file, out_pcap_file, filters) - - s.close() - sleep(1) - cmd = "^C" - self.dut.send_expect(cmd, "# ", 20) + out_pcap_1 = 'pipeline/met_001/pcap_files/out_41.txt' + out_pcap_2 = 'pipeline/met_001/pcap_files/out_42.txt' + out_pcap_3 = 'pipeline/met_001/pcap_files/out_43.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + self.dut.send_expect("^C", "# ", 20) + + def test_met_002(self): + + cli_file = '/tmp/pipeline/met_002/met_002.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_002/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_002/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_002/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_002/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_002/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_002/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_002/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_003(self): + + cli_file = '/tmp/pipeline/met_003/met_003.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_003/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_003/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_003/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_003/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_003/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_003/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_003/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_004(self): + + cli_file = '/tmp/pipeline/met_004/met_004.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_004/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_004/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_004/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_004/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_004/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_004/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_004/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_005(self): + + cli_file = '/tmp/pipeline/met_005/met_005.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_005/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_005/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_005/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_005/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_005/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_005/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_005/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_006(self): + + cli_file = '/tmp/pipeline/met_006/met_006.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_006/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_006/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_006/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_006/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_006/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_006/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_006/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_007(self): + + cli_file = '/tmp/pipeline/met_007/met_007.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_007/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_007/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_007/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_007/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_007/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_007/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_007/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_008(self): + + cli_file = '/tmp/pipeline/met_008/met_008.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_008/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_008/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_008/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_008/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_008/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_008/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_008/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_009(self): + + cli_file = '/tmp/pipeline/met_009/met_009.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_009/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_009/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_009/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_009/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_009/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_009/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_009/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_010(self): + + cli_file = '/tmp/pipeline/met_010/met_010.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_010/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_010/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_010/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_010/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_010/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_010/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_010/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_011(self): + + cli_file = '/tmp/pipeline/met_011/met_011.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_011/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_011/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_011/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_011/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_011/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_011/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_011/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_012(self): + + cli_file = '/tmp/pipeline/met_012/met_012.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_012/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_012/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_012/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_012/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + + out_pcap_1 = 'pipeline/met_012/pcap_files/out_21.txt' + out_pcap_2 = 'pipeline/met_012/pcap_files/out_22.txt' + out_pcap_3 = 'pipeline/met_012/pcap_files/out_23.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 10) + self.dut.send_expect("^C", "# ", 20) + + def test_met_013(self): + + cli_file = '/tmp/pipeline/met_013/met_013.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_013/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_013/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_013/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_013/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + self.dut.send_expect("^C", "# ", 20) + + def test_met_014(self): + + cli_file = '/tmp/pipeline/met_014/met_014.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_014/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_014/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_014/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_014/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + self.dut.send_expect("^C", "# ", 20) + + def test_met_015(self): + + cli_file = '/tmp/pipeline/met_015/met_015.cli' + self.run_dpdk_app(cli_file) + + in_pcap = ['pipeline/met_015/pcap_files/in_1.txt'] + out_pcap_1 = 'pipeline/met_015/pcap_files/out_11.txt' + out_pcap_2 = 'pipeline/met_015/pcap_files/out_12.txt' + out_pcap_3 = 'pipeline/met_015/pcap_files/out_13.txt' + out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3] + filters = ["tcp"] * 3 + tx_port = [0] + rx_port = [0, 1, 2] + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters, 1000) + self.dut.send_expect("^C", "# ", 20) + + ''' + def test_tap_port_001(self): + + cli_file = '/tmp/pipeline/tap_port_001/tap_port_001.cli' + self.run_dpdk_app(cli_file) + + in_pcap = 'pipeline/tap_port_001/pcap_files/in_1.txt' + out_pcap = 'pipeline/tap_port_001/pcap_files/out_1.txt' + self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, "udp") + self.dut.send_expect("^C", "# ", 20) + ''' + + def test_ring_port_001(self): + + cli_file = '/tmp/pipeline/ring_port_001/ring_port_001.cli' + self.run_dpdk_app(cli_file) + + 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) + + def test_tencent_001(self): + + cli_file = '/tmp/pipeline/tencent_001/tencent_001.cli' + self.run_dpdk_app(cli_file) + base_dir = 'pipeline/tencent_001/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"] * 4 + 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"] * 4 + 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"] * 4 + 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"] * 4 + self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters) + self.dut.send_expect("^C", "# ", 20) def tear_down(self): """ -- 1.8.3.1