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 98F33A0561; Thu, 18 Mar 2021 06:40:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 930EF14104D; Thu, 18 Mar 2021 06:40:02 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 163D8141049 for ; Thu, 18 Mar 2021 06:39:59 +0100 (CET) IronPort-SDR: U/1eSRizHiryfbg6iEVjg9HYMCAbAIhB+ncer2zqbg0A77awVFZt+nOxWpZ/hS5QNuDhEIFj9d 9tVOZFNuJBtA== X-IronPort-AV: E=McAfee;i="6000,8403,9926"; a="176736181" X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="176736181" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 22:39:58 -0700 IronPort-SDR: zPHdDh1AZwvKDcNGb8kO5QVN5m+iDrDy11fj1gjVGAtapLlIDYMvgOWy1RrWuWgxf6Vtcjtkpr NJDlVIub/JKw== X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="406214342" Received: from unknown (HELO dpdk-huangzm-d.sh.intel.com) ([10.240.183.72]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 22:39:54 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Thu, 18 Mar 2021 13:27:28 +0800 Message-Id: <1616045251-65532-6-git-send-email-zhiminx.huang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1616045251-65532-1-git-send-email-zhiminx.huang@intel.com> References: <1616045251-65532-1-git-send-email-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 5/8] tests/cvl_switch_filter:support nic and pkg check 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" *.split pppoe into new suite and add pkg check Signed-off-by: Zhimin Huang --- tests/TestSuite_cvl_switch_filter.py | 2761 ++-------------------------------- 1 file changed, 134 insertions(+), 2627 deletions(-) diff --git a/tests/TestSuite_cvl_switch_filter.py b/tests/TestSuite_cvl_switch_filter.py index cc0283b..dcf9a57 100644 --- a/tests/TestSuite_cvl_switch_filter.py +++ b/tests/TestSuite_cvl_switch_filter.py @@ -37,7 +37,7 @@ import copy import random from itertools import groupby -from test_case import TestCase +from test_case import TestCase, skip_unsupported_pkg from pmd_output import PmdOutput from packet import Packet from utils import BLUE, RED, GREEN @@ -1618,69 +1618,6 @@ tvs_ethertype_filter_pppoed = [ tv_ethertype_filter_pppoed_drop_02 ] -#test vector ethertype_filter_pppoes -ethertype_filter_pppoes_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55", type=0x8864)/PPPoE(sessionid=3)/Raw("x" *80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55", type=0x8863)/PPPoED()/Raw("x" *80)' - ] -} - -tv_ethertype_filter_pppoes_in_queue_01 = { - "name":"tv_ethertype_filter_pppoes_in_queue_01", - "rte_flow_pattern":"flow create 0 ingress pattern eth type is 0x8864 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":ethertype_filter_pppoes_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":ethertype_filter_pppoes_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}} -} - -tv_ethertype_filter_pppoes_queue_region_02 = { - "name":"tv_ethertype_filter_pppoes_queue_region_02", - "rte_flow_pattern":"flow create 0 ingress pattern eth type is 0x8864 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":ethertype_filter_pppoes_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":ethertype_filter_pppoes_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}} -} - -tv_ethertype_filter_pppoes_drop_03 = { - "name":"tv_ethertype_filter_pppoes_drop_03", - "rte_flow_pattern":"flow create 0 ingress pattern eth type is 0x8864 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":ethertype_filter_pppoes_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":ethertype_filter_pppoes_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}} -} - -tvs_ethertype_filter_pppoes = [ - tv_ethertype_filter_pppoes_in_queue_01, - tv_ethertype_filter_pppoes_queue_region_02, - tv_ethertype_filter_pppoes_drop_03 - ] - #non-tunnel pipeline mode #test vector mac_ipv4_frag_pipeline_mode mac_ipv4_frag_pipeline_mode_scapy_str = { @@ -2583,2056 +2520,146 @@ tvs_mac_ipv6_tcp_non_pipeline_mode = [ tv_mac_ipv6_tcp_drop_queue_02 ] -#20.08 -mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x"*80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:54",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_pay_session_id_proto_id_in_queue_01", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":4}} -} +test_results = OrderedDict() -tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_pay_session_id_proto_id_queue_region_02", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":4}} -} +class CVLSwitchFilterTest(TestCase): -tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_drop_03 = { - "name":"tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_drop_03", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} + def bind_nics_driver(self, ports, driver=""): + # modprobe vfio driver + if driver == "vfio-pci": + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver = netdev.get_nic_driver() + if driver != 'vfio-pci': + netdev.bind_driver(driver='vfio-pci') -tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id = [ - tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_in_queue_01, - tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_queue_region_02, - tv_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_drop_03 - ] + elif driver == "igb_uio": + # igb_uio should insmod as default, no need to check + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver = netdev.get_nic_driver() + if driver != 'igb_uio': + netdev.bind_driver(driver='igb_uio') + else: + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver_now = netdev.get_nic_driver() + if driver == "": + driver = netdev.default_driver + if driver != driver_now: + netdev.bind_driver(driver=driver) + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.verify(self.nic in ["columbiaville_25g","columbiaville_100g"], "%s nic not support CVL switch filter" % self.nic) + self.dut_ports = self.dut.get_ports(self.nic) + # Verify that enough ports are available + self.verify(len(self.dut_ports) >= 1, "Insufficient ports") + localPort = self.tester.get_local_port(self.dut_ports[0]) + self.__tx_iface = self.tester.get_interface(localPort) + self.dut.send_expect("ifconfig %s up" % self.__tx_iface, "# ") + self.pkt = Packet() + self.pmd = PmdOutput(self.dut) -mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:54",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} + self.generate_file_with_fdir_rules() + self.path = self.dut.apps_name['test-pmd'] -tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_pay_session_id_proto_id_in_queue_01", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":4}} -} + def set_up(self): + """ + Run before each test case. + """ -tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_pay_session_id_proto_id_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":4}} -} + def generate_file_with_fdir_rules(self): + """ + generate file with fdir rules to make fdir table full, then test switch filter + """ + pf_pci = self.dut.ports_info[0]['pci'] + out = self.pmd.start_testpmd('default', eal_param='-a %s --log-level=ice,7'%pf_pci) + self.dut.send_expect("quit", "# ") + self.fdir_rule_number = self.pmd.get_max_rule_number(self,out) + src_file = 'dep/testpmd_cmds_rte_flow_fdir_rules' + flows = open(src_file, mode='w') + rule_count = 1 + for i in range(0,255): + for j in range(0,255): + if not rule_count > self.fdir_rule_number: + flows.write('flow create 0 ingress pattern eth / ipv4 src is 192.168.%d.%d dst is 192.1.0.0 tos is 4 / tcp src is 25 dst is 23 / end actions queue index 5 / end \n' % (i, j)) + rule_count += 1 + else: + break + if rule_count > self.fdir_rule_number: + break + flows.close() + self.dut_file_dir = '/tmp' + self.dut.session.copy_file_to(src_file, self.dut_file_dir) + self.fdir_file = "/tmp/testpmd_cmds_rte_flow_fdir_rules" -tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_pay_session_id_proto_id_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} + def create_testpmd_command(self): + """ + Create testpmd command for non-pipeline mode + """ + #Prepare testpmd EAL and parameters + all_eal_param = self.dut.create_eal_parameters(cores='1S/4C/1T', ports=[0]) + command = self.path + all_eal_param + " --log-level=\"ice,8\" -- -i --rxq=16 --txq=16 --cmdline-file=%s" % self.fdir_file + # command = "./%s/app/testpmd %s --log-level=\"ice,8\" -- -i %s" % (self.dut.target, all_eal_param, "--rxq=16 --txq=16") + return command -tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id = [ - tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_in_queue_01, - tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_queue_region_02, - tv_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_drop_03 - ] + def create_testpmd_command_pipeline_mode(self): + """ + Create testpmd command for pipeline mode + """ + #Prepare testpmd EAL and parameters + all_eal_param = self.dut.create_eal_parameters(cores='1S/4C/1T', ports=[0], port_options={0:"pipeline-mode-support=1"}) + command = self.path + all_eal_param + " --log-level=\"ice,8\" -- -i --rxq=16 --txq=16" + return command -mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:54",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)' - ] -} + def launch_testpmd(self, is_non_pipeline): + """ + launch testpmd with the command + """ + if is_non_pipeline: + command = self.create_testpmd_command() + else: + command = self.create_testpmd_command_pipeline_mode() + out = self.dut.send_expect(command, "testpmd> ", 300) + self.dut.send_expect("port config all rss all", "testpmd> ", 15) + self.dut.send_expect("port config 0 rss-hash-key ipv4 1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd", "testpmd> ", 15) + self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ", 15) + self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) + self.dut.send_expect("set verbose 1", "testpmd> ", 15) -tv_mac_pppoe_ipv4_pay_session_id_proto_id_in_queue_01 = { - "name":"mac_pppoe_ipv4_pay_session_id_proto_id_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":3}} -} + def send_and_check_packets(self, dic, port): + """ + general packets processing workflow. + """ + #Specify the port to use + dic["check_func"]["param"]["expect_port"] = port + self.dut.send_expect("start", "testpmd> ", 15) + time.sleep(2) + #send packets + self.pkt.update_pkt(dic["scapy_str"]) + self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) + time.sleep(3) + out = self.dut.send_expect("stop", "testpmd> ", 15) + result_flag, log_msg = dic["check_func"]["func"](out, dic["check_func"]["param"], dic["expect_results"]) + return result_flag, log_msg -tv_mac_pppoe_ipv4_pay_session_id_proto_id_queue_region_02 = { - "name":"mac_pppoe_ipv4_pay_session_id_proto_id_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv4_pay_session_id_proto_id_drop_03 = { - "name":"mac_pppoe_ipv4_pay_session_id_proto_id_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_ipv4_pay_session_id_proto_id = [ - tv_mac_pppoe_ipv4_pay_session_id_proto_id_in_queue_01, - tv_mac_pppoe_ipv4_pay_session_id_proto_id_queue_region_02, - tv_mac_pppoe_ipv4_pay_session_id_proto_id_drop_03 - ] - -mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:54",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x00\\x57\')/IPv6()/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv6_pay_session_id_proto_id_in_queue_01 = { - "name":"mac_pppoe_ipv6_pay_session_id_proto_id_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_pay_session_id_proto_id_queue_region_02 = { - "name":"mac_pppoe_ipv6_pay_session_id_proto_id_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_pay_session_id_proto_id_drop_03 = { - "name":"mac_pppoe_ipv6_pay_session_id_proto_id_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x0057 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_session_id_proto_id_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_ipv6_pay_session_id_proto_id = [ - tv_mac_pppoe_ipv6_pay_session_id_proto_id_in_queue_01, - tv_mac_pppoe_ipv6_pay_session_id_proto_id_queue_region_02, - tv_mac_pppoe_ipv6_pay_session_id_proto_id_drop_03 - ] - -mac_pppoe_ipv4_pay_ip_address_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x"*80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/Raw("x"*80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/Raw("x"*80)' - ] -} - -tv_mac_pppoe_ipv4_pay_ip_address_in_queue_01 = { - "name":"mac_pppoe_ipv4_pay_ip_address_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_pppoe_ipv4_pay_ip_address_queue_region_02 = { - "name":"mac_pppoe_ipv4_pay_ip_address_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_pppoe_ipv4_pay_ip_address_drop_03 = { - "name":"mac_pppoe_ipv4_pay_ip_address_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":2}} -} - -tvs_mac_pppoe_ipv4_pay_ip_address = [ - tv_mac_pppoe_ipv4_pay_ip_address_in_queue_01, - tv_mac_pppoe_ipv4_pay_ip_address_queue_region_02, - tv_mac_pppoe_ipv4_pay_ip_address_drop_03 - ] - -mac_pppoe_ipv4_udp_pay_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv4_udp_pay_in_queue_01 = { - "name":"mac_pppoe_ipv4_udp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_udp_pay_queue_region_02 = { - "name":"mac_pppoe_ipv4_udp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_udp_pay_drop_03 = { - "name":"mac_pppoe_ipv4_udp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv4_udp_pay = [ - tv_mac_pppoe_ipv4_udp_pay_in_queue_01, - tv_mac_pppoe_ipv4_udp_pay_queue_region_02, - tv_mac_pppoe_ipv4_udp_pay_drop_03 - ] - -mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03 = { - "name":"mac_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port = [ - tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01, - tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02, - tv_mac_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03 - ] - -mac_pppoe_ipv4_tcp_pay_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv4_tcp_pay_in_queue_01 = { - "name":"mac_pppoe_ipv4_tcp_pay_in_queue_01", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_tcp_pay_queue_region_02 = { - "name":"mac_pppoe_ipv4_tcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_tcp_pay_drop_03 = { - "name":"mac_pppoe_ipv4_tcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv4_tcp_pay = [ - tv_mac_pppoe_ipv4_tcp_pay_in_queue_01, - tv_mac_pppoe_ipv4_tcp_pay_queue_region_02, - tv_mac_pppoe_ipv4_tcp_pay_drop_03 - ] - -mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03 = { - "name":"mac_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port = [ - tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01, - tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02, - tv_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03 - ] - -mac_pppoe_ipv6_pay_ip_address_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x"*80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x"*80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/Raw("x"*80)' - ] -} - -tv_mac_pppoe_ipv6_pay_ip_address_in_queue_01 = { - "name":"mac_pppoe_ipv6_pay_ip_address_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_pppoe_ipv6_pay_ip_address_queue_region_02 = { - "name":"mac_pppoe_ipv6_pay_ip_address_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_pppoe_ipv6_pay_ip_address_drop_03 = { - "name":"mac_pppoe_ipv6_pay_ip_address_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":2}} -} - -tvs_mac_pppoe_ipv6_pay_ip_address = [ - tv_mac_pppoe_ipv6_pay_ip_address_in_queue_01, - tv_mac_pppoe_ipv6_pay_ip_address_queue_region_02, - tv_mac_pppoe_ipv6_pay_ip_address_drop_03 - ] - -mac_pppoe_ipv6_udp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv6_udp_pay_in_queue_01 = { - "name":"mac_pppoe_ipv6_udp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_udp_pay_queue_region_02 = { - "name":"mac_pppoe_ipv6_udp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_udp_pay_drop_03 = { - "name":"mac_pppoe_ipv6_udp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_ipv6_udp_pay = [ - tv_mac_pppoe_ipv6_udp_pay_in_queue_01, - tv_mac_pppoe_ipv6_udp_pay_queue_region_02, - tv_mac_pppoe_ipv6_udp_pay_drop_03 - ] - -mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03 = { - "name":"mac_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port = [ - tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01, - tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02, - tv_mac_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03 - ] - -mac_pppoe_ipv6_tcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv6_tcp_pay_in_queue_01 = { - "name":"mac_pppoe_ipv6_tcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_tcp_pay_queue_region_02 = { - "name":"mac_pppoe_ipv6_tcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipv6_tcp_pay_drop_03 = { - "name":"mac_pppoe_ipv6_tcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_ipv6_tcp_pay = [ - tv_mac_pppoe_ipv6_tcp_pay_in_queue_01, - tv_mac_pppoe_ipv6_tcp_pay_queue_region_02, - tv_mac_pppoe_ipv6_tcp_pay_drop_03 - ] - -mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03 = { - "name":"mac_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port = [ - tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01, - tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02, - tv_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03 - ] - -mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x"*80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x"*80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/Raw("x"*80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/Raw("x"*80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_pay_ip_address_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_pay_ip_address_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_vlan_pppoe_ipv4_pay_ip_address_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_pay_ip_address_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_vlan_pppoe_ipv4_pay_ip_address_drop_03 = { - "name":"mac_vlan_pppoe_ipv4_pay_ip_address_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_vlan_pppoe_ipv4_pay_ip_address = [ - tv_mac_vlan_pppoe_ipv4_pay_ip_address_in_queue_01, - tv_mac_vlan_pppoe_ipv4_pay_ip_address_queue_region_02, - tv_mac_vlan_pppoe_ipv4_pay_ip_address_drop_03 - ] - -mac_vlan_pppoe_ipv4_udp_pay_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_drop_03 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":5}} -} - -tvs_mac_vlan_pppoe_ipv4_udp_pay = [ - tv_mac_vlan_pppoe_ipv4_udp_pay_in_queue_01, - tv_mac_vlan_pppoe_ipv4_udp_pay_queue_region_02, - tv_mac_vlan_pppoe_ipv4_udp_pay_drop_03 - ] - -mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03 = { - "name":"mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / udp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":5}} -} - -tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port = [ - tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_in_queue_01, - tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_queue_region_02, - tv_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_drop_03 - ] - -mac_vlan_pppoe_ipv4_tcp_pay_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_drop_03 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":5}} -} - -tvs_mac_vlan_pppoe_ipv4_tcp_pay = [ - tv_mac_vlan_pppoe_ipv4_tcp_pay_in_queue_01, - tv_mac_vlan_pppoe_ipv4_tcp_pay_queue_region_02, - tv_mac_vlan_pppoe_ipv4_tcp_pay_drop_03 - ] - -mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.2")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.4")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions queue index 2 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions queue index 2 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":2}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions rss queues 7 8 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions rss queues 7 8 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[7, 8]}}, - "expect_results":{"expect_pkts":5}} -} - -tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03 = { - "name":"mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / tcp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":5}} -} - -tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port = [ - tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_in_queue_01, - tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_queue_region_02, - tv_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_drop_03 - ] - -mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x"*80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x"*80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x"*80)' - ] -} - -tv_mac_vlan_pppoe_ipv6_pay_ip_address_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_pay_ip_address_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_vlan_pppoe_ipv6_pay_ip_address_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_pay_ip_address_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":2}} -} - -tv_mac_vlan_pppoe_ipv6_pay_ip_address_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_pay_ip_address_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_pay_ip_address_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":2}} -} - -tvs_mac_vlan_pppoe_ipv6_pay_ip_address = [ - tv_mac_vlan_pppoe_ipv6_pay_ip_address_in_queue_01, - tv_mac_vlan_pppoe_ipv6_pay_ip_address_queue_region_02, - tv_mac_vlan_pppoe_ipv6_pay_ip_address_drop_03 - ] - -mac_vlan_pppoe_ipv6_udp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_ipv6_udp_pay = [ - tv_mac_vlan_pppoe_ipv6_udp_pay_in_queue_01, - tv_mac_vlan_pppoe_ipv6_udp_pay_queue_region_02, - tv_mac_vlan_pppoe_ipv6_udp_pay_drop_03 - ] - -mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / udp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port = [ - tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_in_queue_01, - tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_queue_region_02, - tv_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_drop_03 - ] - -mac_vlan_pppoe_ipv6_tcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=27,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=19)/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions rss queues 4 5 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[4, 5]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / tcp src is 25 dst is 23 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_ipv6_tcp_pay = [ - tv_mac_vlan_pppoe_ipv6_tcp_pay_in_queue_01, - tv_mac_vlan_pppoe_ipv6_tcp_pay_queue_region_02, - tv_mac_vlan_pppoe_ipv6_tcp_pay_drop_03 - ] - -mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1537", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/TCP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/UDP(sport=25,dport=23)/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x57\')/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1536", dst="CDCD:910A:2222:5498:8475:1111:3900:2022")/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03 = { - "name":"mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth / vlan tci is 1 / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 / tcp / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":False}, - "matched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port = [ - tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_in_queue_01, - tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_queue_region_02, - tv_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_drop_03 - ] - -mac_pppoe_lcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:53",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_lcp_pay_in_queue_01 = { - "name":"mac_pppoe_lcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_lcp_pay_queue_region_02 = { - "name":"mac_pppoe_lcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_lcp_pay_drop_03 = { - "name":"mac_pppoe_lcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_lcp_pay = [ - tv_mac_pppoe_lcp_pay_in_queue_01, - tv_mac_pppoe_lcp_pay_queue_region_02, - tv_mac_pppoe_lcp_pay_drop_03 - ] - -mac_pppoe_ipcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:53",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} - -tv_mac_pppoe_ipcp_pay_in_queue_01 = { - "name":"mac_pppoe_ipcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipcp_pay_queue_region_02 = { - "name":"mac_pppoe_ipcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":3}} -} - -tv_mac_pppoe_ipcp_pay_drop_03 = { - "name":"mac_pppoe_ipcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":3}} -} - -tvs_mac_pppoe_ipcp_pay = [ - tv_mac_pppoe_ipcp_pay_in_queue_01, - tv_mac_pppoe_ipcp_pay_queue_region_02, - tv_mac_pppoe_ipcp_pay_drop_03 - ] - -mac_vlan_pppoe_lcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:53",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\xc0\\x21\')/PPP_LCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_lcp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_lcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_lcp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_lcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_lcp_pay_drop_03 = { - "name":"mac_vlan_pppoe_lcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0xc021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_lcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_lcp_pay = [ - tv_mac_vlan_pppoe_lcp_pay_in_queue_01, - tv_mac_vlan_pppoe_lcp_pay_queue_region_02, - tv_mac_vlan_pppoe_lcp_pay_drop_03 - ] - -mac_vlan_pppoe_ipcp_pay_scapy_str = { - "matched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)'], - "mismatched": [ - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:53",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=4)/PPP(b\'\\x80\\x21\')/PPP_IPCP()/Raw("x" * 80)', - 'Ether(src="11:22:33:44:55:99",dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP()/Raw("x" * 80)' - ] -} - -tv_mac_vlan_pppoe_ipcp_pay_in_queue_01 = { - "name":"mac_vlan_pppoe_ipcp_pay_in_queue_01", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions queue index 1 / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions queue index 1 / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_in_queue, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_in_queue_mismatched, - "param":{"expect_port":0, "expect_queues":1}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipcp_pay_queue_region_02 = { - "name":"mac_vlan_pppoe_ipcp_pay_queue_region_02", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions rss queues 2 3 end / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions rss queues 2 3 end / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_queue_region, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_queue_region_mismatched, - "param":{"expect_port":0, "expect_queues":[2, 3]}}, - "expect_results":{"expect_pkts":4}} -} - -tv_mac_vlan_pppoe_ipcp_pay_drop_03 = { - "name":"mac_vlan_pppoe_ipcp_pay_drop_03", - "validate_pattern":"flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions drop / end", - "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x8021 / end actions drop / end", - "configuration":{ - "is_non_pipeline":True, - "is_need_rss_rule":True}, - "matched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["matched"], - "check_func":{"func":rfc.check_output_log_drop, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":1}}, - "mismatched":{"scapy_str":mac_vlan_pppoe_ipcp_pay_scapy_str["mismatched"], - "check_func":{"func":rfc.check_output_log_drop_mismatched, - "param":{"expect_port":0, "expect_queues":"null"}}, - "expect_results":{"expect_pkts":4}} -} - -tvs_mac_vlan_pppoe_ipcp_pay = [ - tv_mac_vlan_pppoe_ipcp_pay_in_queue_01, - tv_mac_vlan_pppoe_ipcp_pay_queue_region_02, - tv_mac_vlan_pppoe_ipcp_pay_drop_03 - ] - -test_results = OrderedDict() - -class CVLSwitchFilterTest(TestCase): - - def bind_nics_driver(self, ports, driver=""): - # modprobe vfio driver - if driver == "vfio-pci": - for port in ports: - netdev = self.dut.ports_info[port]['port'] - driver = netdev.get_nic_driver() - if driver != 'vfio-pci': - netdev.bind_driver(driver='vfio-pci') - - elif driver == "igb_uio": - # igb_uio should insmod as default, no need to check - for port in ports: - netdev = self.dut.ports_info[port]['port'] - driver = netdev.get_nic_driver() - if driver != 'igb_uio': - netdev.bind_driver(driver='igb_uio') - else: - for port in ports: - netdev = self.dut.ports_info[port]['port'] - driver_now = netdev.get_nic_driver() - if driver == "": - driver = netdev.default_driver - if driver != driver_now: - netdev.bind_driver(driver=driver) - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.verify(self.nic in ["columbiaville_25g","columbiaville_100g"], "%s nic not support CVL switch filter" % self.nic) - self.dut_ports = self.dut.get_ports(self.nic) - # Verify that enough ports are available - self.verify(len(self.dut_ports) >= 1, "Insufficient ports") - localPort = self.tester.get_local_port(self.dut_ports[0]) - self.__tx_iface = self.tester.get_interface(localPort) - self.dut.send_expect("ifconfig %s up" % self.__tx_iface, "# ") - self.pkt = Packet() - #bind pf to kernel - self.bind_nics_driver(self.dut_ports, driver="ice") - #move comms package to package folder - self.suite_config = rfc.get_suite_config(self) - self.os_package_location = self.suite_config["os_default_package_file_location"] - self.comms_package_location = self.suite_config["comms_package_file_location"] - self.package_location = self.suite_config["package_file_location"] - self.dut.send_expect("cp %s %s" % (self.comms_package_location, self.package_location), "# ") - self.re_load_ice_driver() - #bind pf to vfio-pci - self.dut.send_expect('modprobe vfio-pci', '#') - self.bind_nics_driver(self.dut_ports, driver="vfio-pci") - self.pmd = PmdOutput(self.dut) - - self.generate_file_with_fdir_rules() - self.path = self.dut.apps_name['test-pmd'] - - def set_up(self): - """ - Run before each test case. - """ - - def re_load_ice_driver(self): - """ - remove and reload the driver - """ - ice_driver_file_location = self.suite_config["ice_driver_file_location"] - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("insmod %s" % ice_driver_file_location, "# ", 60) - time.sleep(5) - - def generate_file_with_fdir_rules(self): - """ - generate file with fdir rules to make fdir table full, then test switch filter - """ - pf_pci = [self.dut.ports_info[0]['pci']] - out = self.pmd.start_testpmd('default', ports=pf_pci, eal_param='--log-level=ice,7') - self.dut.send_expect("quit", "# ") - self.fdir_rule_number = self.pmd.get_max_rule_number(self,out) - src_file = 'dep/testpmd_cmds_rte_flow_fdir_rules' - flows = open(src_file, mode='w') - rule_count = 1 - for i in range(0,255): - for j in range(0,255): - if not rule_count > self.fdir_rule_number: - flows.write('flow create 0 ingress pattern eth / ipv4 src is 192.168.%d.%d dst is 192.1.0.0 tos is 4 / tcp src is 25 dst is 23 / end actions queue index 5 / end \n' % (i, j)) - rule_count += 1 - else: - break - if rule_count > self.fdir_rule_number: - break - flows.close() - self.dut_file_dir = '/tmp' - self.dut.session.copy_file_to(src_file, self.dut_file_dir) - self.fdir_file = "/tmp/testpmd_cmds_rte_flow_fdir_rules" - - def create_testpmd_command(self): - """ - Create testpmd command for non-pipeline mode - """ - #Prepare testpmd EAL and parameters - all_eal_param = self.dut.create_eal_parameters(cores='1S/4C/1T', ports=[0]) - command = self.path + all_eal_param + " --log-level=\"ice,8\" -- -i --rxq=16 --txq=16 --cmdline-file=%s" % self.fdir_file - # command = "./%s/app/testpmd %s --log-level=\"ice,8\" -- -i %s" % (self.dut.target, all_eal_param, "--rxq=16 --txq=16") - return command - - def create_testpmd_command_pipeline_mode(self): - """ - Create testpmd command for pipeline mode - """ - #Prepare testpmd EAL and parameters - all_eal_param = self.dut.create_eal_parameters(cores='1S/4C/1T', ports=[0], port_options={0:"pipeline-mode-support=1"}) - command = self.path + all_eal_param + " --log-level=\"ice,8\" -- -i --rxq=16 --txq=16" - return command - - def launch_testpmd(self, is_non_pipeline): - """ - launch testpmd with the command - """ - if is_non_pipeline: - command = self.create_testpmd_command() - else: - command = self.create_testpmd_command_pipeline_mode() - out = self.dut.send_expect(command, "testpmd> ", 300) - self.dut.send_expect("port config all rss all", "testpmd> ", 15) - self.dut.send_expect("port config 0 rss-hash-key ipv4 1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd", "testpmd> ", 15) - self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ", 15) - self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) - self.dut.send_expect("set verbose 1", "testpmd> ", 15) - - def send_and_check_packets(self, dic, port): - """ - general packets processing workflow. - """ - #Specify the port to use - dic["check_func"]["param"]["expect_port"] = port - self.dut.send_expect("start", "testpmd> ", 15) - time.sleep(2) - #send packets - self.pkt.update_pkt(dic["scapy_str"]) - self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) - time.sleep(3) - out = self.dut.send_expect("stop", "testpmd> ", 15) - result_flag, log_msg = dic["check_func"]["func"](out, dic["check_func"]["param"], dic["expect_results"]) - return result_flag, log_msg - - def send_packet_get_queue(self, packets_list): - """ - general packets processing workflow. - """ - self.dut.send_expect("start", "testpmd> ") - # send packets - self.pkt.update_pkt(packets_list) - self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) - time.sleep(3) - out = self.dut.send_expect("stop", "testpmd> ", 15) - p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)") - res = p.findall(out) - default_queue = [int(i) for i in res] - return default_queue + def send_packet_get_queue(self, packets_list): + """ + general packets processing workflow. + """ + self.dut.send_expect("start", "testpmd> ") + # send packets + self.pkt.update_pkt(packets_list) + self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) + time.sleep(3) + out = self.dut.send_expect("stop", "testpmd> ", 15) + p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)") + res = p.findall(out) + default_queue = [int(i) for i in res] + return default_queue def get_available_queue_num(self, default_queue, expect_queue, pmd_queue=8): """ @@ -5007,13 +3034,6 @@ class CVLSwitchFilterTest(TestCase): def test_ethertype_filter_pppoed(self): self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed) - def test_ethertype_filter_pppoes(self): - #launch testpmd - self.launch_testpmd(True) - #create a pppoe rss rule to make the pppoe packets have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoes, False) - #ether filter pipeline mode def test_ethertype_filter_pppoed_pipeline_mode(self): tvs_ethertype_filter_pppoed_pipeline_mode = copy.deepcopy(tvs_ethertype_filter_pppoed) @@ -5023,18 +3043,6 @@ class CVLSwitchFilterTest(TestCase): tv["configuration"]["is_non_pipeline"] = False self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed_pipeline_mode) - def test_ethertype_filter_pppoes_pipeline_mode(self): - tvs_ethertype_filter_pppoes_pipeline_mode = copy.deepcopy(tvs_ethertype_filter_pppoes) - for tv in tvs_ethertype_filter_pppoes_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - #launch testpmd - self.launch_testpmd(False) - #create a pppoe rss rule to make the pppoe packets have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoes_pipeline_mode, False) - #non-tunnel pipeline mode def test_mac_ipv4_frag_pipeline_mode(self): self._rte_flow_validate_pattern(tvs_mac_ipv4_frag_pipeline_mode) @@ -5082,499 +3090,7 @@ class CVLSwitchFilterTest(TestCase): def test_mac_ipv6_tcp_non_pipeline_mode(self): self._rte_flow_validate_pattern(tvs_mac_ipv6_tcp_non_pipeline_mode) - # 20.08 - def test_mac_vlan_pppoe_ipv4_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id) - - def test_mac_vlan_pppoe_ipv6_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id) - - def test_mac_pppoe_ipv4_pay_session_id_proto_id_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_pay_session_id_proto_id) - - def test_mac_pppoe_ipv6_pay_session_id_proto_id_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_pay_session_id_proto_id) - - def test_mac_pppoe_ipv4_pay_ip_address_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_pay_ip_address) - - def test_mac_pppoe_ipv4_udp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_udp_pay) - - def test_mac_pppoe_ipv4_udp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port) - - def test_mac_pppoe_ipv4_tcp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_tcp_pay) - - def test_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port) - - def test_mac_pppoe_ipv6_pay_ip_address_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_pay_ip_address) - - def test_mac_pppoe_ipv6_udp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_udp_pay) - - def test_mac_pppoe_ipv6_udp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port) - - def test_mac_pppoe_ipv6_tcp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_tcp_pay) - - def test_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port) - - def test_mac_vlan_pppoe_ipv4_pay_ip_address_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_ip_address) - - def test_mac_vlan_pppoe_ipv4_udp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_udp_pay) - - def test_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port) - - def test_mac_vlan_pppoe_ipv4_tcp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_tcp_pay) - - def test_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port) - - def test_mac_vlan_pppoe_ipv6_pay_ip_address_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_pay_ip_address) - - def test_mac_vlan_pppoe_ipv6_udp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_udp_pay) - - def test_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port) - - def test_mac_vlan_pppoe_ipv6_tcp_pay_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_tcp_pay) - - def test_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_non_pipeline_mode(self): - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port) - - # pppoe control - def test_mac_pppoe_lcp_pay_non_pipeline_mode(self): - #launch testpmd - self.launch_testpmd(True) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_pppoe_lcp_pay, False) - - def test_mac_pppoe_ipcp_pay_non_pipeline_mode(self): - #launch testpmd - self.launch_testpmd(True) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipcp_pay, False) - - def test_mac_vlan_pppoe_lcp_pay_non_pipeline_mode(self): - #launch testpmd - self.launch_testpmd(True) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_lcp_pay, False) - - def test_mac_vlan_pppoe_ipcp_pay_non_pipeline_mode(self): - #launch testpmd - self.launch_testpmd(True) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipcp_pay, False) - - # 20.08 pipeline mode - def test_mac_vlan_pppoe_ipv4_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id) - for tv in tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id) - for tv in tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode) - - def test_mac_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode(self): - tvs_mac_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_pay_session_id_proto_id) - for tv in tvs_mac_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_pay_session_id_proto_id_pipeline_mode) - - def test_mac_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode(self): - tvs_mac_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_pay_session_id_proto_id) - for tv in tvs_mac_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_pay_session_id_proto_id_pipeline_mode) - - def test_mac_pppoe_ipv4_pay_ip_address_pipeline_mode(self): - tvs_mac_pppoe_ipv4_pay_ip_address_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_pay_ip_address) - for tv in tvs_mac_pppoe_ipv4_pay_ip_address_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_pay_ip_address_pipeline_mode) - - def test_mac_pppoe_ipv4_udp_pay_pipeline_mode(self): - tvs_mac_pppoe_ipv4_udp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_udp_pay) - for tv in tvs_mac_pppoe_ipv4_udp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_udp_pay_pipeline_mode) - - def test_mac_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port) - for tv in tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_pppoe_ipv4_tcp_pay_pipeline_mode(self): - tvs_mac_pppoe_ipv4_tcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_tcp_pay) - for tv in tvs_mac_pppoe_ipv4_tcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_tcp_pay_pipeline_mode) - - def test_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port) - for tv in tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_pppoe_ipv6_pay_ip_address_pipeline_mode(self): - tvs_mac_pppoe_ipv6_pay_ip_address_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_pay_ip_address) - for tv in tvs_mac_pppoe_ipv6_pay_ip_address_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_pay_ip_address_pipeline_mode) - - def test_mac_pppoe_ipv6_udp_pay_pipeline_mode(self): - tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_udp_pay) - for tv in tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode) - - def test_mac_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port) - for tv in tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_pppoe_ipv6_tcp_pay_pipeline_mode(self): - tvs_mac_pppoe_ipv6_tcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_tcp_pay) - for tv in tvs_mac_pppoe_ipv6_tcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_tcp_pay_pipeline_mode) - - def test_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port) - for tv in tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_vlan_pppoe_ipv4_pay_ip_address_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_pay_ip_address_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_pay_ip_address) - for tv in tvs_mac_vlan_pppoe_ipv4_pay_ip_address_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_ip_address_pipeline_mode) - - def test_mac_vlan_pppoe_ipv4_udp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_udp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_udp_pay) - for tv in tvs_mac_vlan_pppoe_ipv4_udp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_udp_pay_pipeline_mode) - - def test_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port) - for tv in tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_udp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_vlan_pppoe_ipv4_tcp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_tcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_tcp_pay) - for tv in tvs_mac_vlan_pppoe_ipv4_tcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_tcp_pay_pipeline_mode) - - def test_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port) - for tv in tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_tcp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_pay_ip_address_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_pay_ip_address_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_pay_ip_address) - for tv in tvs_mac_vlan_pppoe_ipv6_pay_ip_address_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_pay_ip_address_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_udp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_udp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_udp_pay) - for tv in tvs_mac_vlan_pppoe_ipv6_udp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_udp_pay_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port) - for tv in tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_udp_pay_non_src_dst_port_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_tcp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_tcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_tcp_pay) - for tv in tvs_mac_vlan_pppoe_ipv6_tcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_tcp_pay_pipeline_mode) - - def test_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port) - for tv in tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv6_tcp_pay_non_src_dst_port_pipeline_mode) - - # 20.08 pppoe control - def test_mac_pppoe_lcp_pay_pipeline_mode(self): - tvs_mac_pppoe_lcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_lcp_pay) - for tv in tvs_mac_pppoe_lcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - #launch testpmd - self.launch_testpmd(False) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_pppoe_lcp_pay_pipeline_mode, False) - - def test_mac_pppoe_ipcp_pay_pipeline_mode(self): - tvs_mac_pppoe_ipcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipcp_pay) - for tv in tvs_mac_pppoe_ipcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - #launch testpmd - self.launch_testpmd(False) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipcp_pay_pipeline_mode, False) - - def test_mac_vlan_pppoe_lcp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_lcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_lcp_pay) - for tv in tvs_mac_vlan_pppoe_lcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - #launch testpmd - self.launch_testpmd(False) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_lcp_pay_pipeline_mode, False) - - def test_mac_vlan_pppoe_ipcp_pay_pipeline_mode(self): - tvs_mac_vlan_pppoe_ipcp_pay_pipeline_mode = copy.deepcopy(tvs_mac_vlan_pppoe_ipcp_pay) - for tv in tvs_mac_vlan_pppoe_ipcp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - #launch testpmd - self.launch_testpmd(False) - #create a pppoe rss rule to make the pppoe control have hash value, and queue group action work - self.dut.send_expect("flow create 0 ingress pattern eth / pppoes / end actions rss types pppoe end key_len 0 queues end / end", "testpmd> ", 15) - self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipcp_pay_pipeline_mode, False) - - def test_negative_case(self): - """ - negative cases - """ - self.launch_testpmd(False) - rules = { - "invalid parameters of queue index" : "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 16 / end", - "invalid parameters of rss queues" : [ - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues 1 2 3 end / end", - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues 0 end / end", - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues end / end", - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues 1 2 3 5 end / end", - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues 15 16 end / end", - "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions rss queues 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 end / end"], - "unsupported input set" : "flow create 0 priority 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.1.2 dst is 192.168.1.3 tos is 4 / end actions queue index 1 / end", - "multiple actions" : "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 1 / rss queues 2 3 end / end", - "void action" : "flow create 0 priority 0 ingress pattern eth / ipv4 / udp src is 25 dst is 23 / end actions end", - "unsupported action": "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions mark id 1 / end", - "void input set value" : "flow create 0 priority 0 ingress pattern eth / ipv4 / end actions queue index 1 / end", - "invalid port" : "flow create 1 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 1 / end" - } - # all the rules failed to validate and create - - # invalid parameters of queue index - rule_list = self.validate_switch_filter_rule(rules["invalid parameters of queue index"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["invalid parameters of queue index"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # invalid parameters of rss queues - rule_list = self.validate_switch_filter_rule(rules["invalid parameters of rss queues"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["invalid parameters of rss queues"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # unsupported input set - rule_list = self.validate_switch_filter_rule(rules["unsupported input set"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["unsupported input set"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # duplicated rules - rule = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 1 / end" - rule_list = self.create_switch_filter_rule(rule, check_stats=False) - self.verify(all(rule_list), "some rules create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == rule_list, "the rule list is not the same. expect %s, result %s" % (rule_list, result)) - rule_list_dupli = self.create_switch_filter_rule(rule, check_stats=False) - self.verify(not any(rule_list_dupli), "all rules should create failed, result %s" % rule_list_dupli) - result_dupli = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result_dupli == rule_list, "the rule list is not the same. expect %s, result %s" % (rule_list, result_dupli)) - self.dut.send_expect("flow destroy 0 rule %s" % rule_list[0], "testpmd> ", 15) - - # conflicted rules - rule = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 1 / end" - rule_list = self.create_switch_filter_rule(rule, check_stats=False) - self.verify(all(rule_list), "some rules create failed, result %s, rule %s" % (rule_list, rule)) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == rule_list, "the rule list is not the same. expect %s, result %s" % (rule_list, result)) - rule1 = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 2 / end" - rule_list1 = self.create_switch_filter_rule(rule1, check_stats=False) - self.verify(not any(rule_list1), "all rules should create failed, result %s" % rule_list1) - rule2 = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions drop / end" - rule_list2 = self.create_switch_filter_rule(rule2, check_stats=False) - self.verify(not any(rule_list2), "all rules should create failed, result %s" % rule_list2) - result1 = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result1 == rule_list, "the rule list is not the same. expect %s, result %s" % (rule_list, result1)) - self.dut.send_expect("flow destroy 0 rule %s" % rule_list[0], "testpmd> ", 15) - - # multiple actions - rule_list = self.validate_switch_filter_rule(rules["multiple actions"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["multiple actions"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # void action - rule_list = self.validate_switch_filter_rule(rules["void action"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["void action"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # delete a non-existing rule - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - out = self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ", 15) - self.verify("error" not in out, "It should be no error message.") - - # add long switch rule - rule = "flow create 0 priority 0 ingress pattern eth / pppoes / ipv6 src is CDCD:910A:2222:5498:8475:1111:3900:1536 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions queue index 1 / end" - rule_list = self.validate_switch_filter_rule(rule, check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rule, check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode = copy.deepcopy(tvs_mac_pppoe_ipv6_udp_pay) - for tv in tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace("flow create 0", "flow create 0 priority 0") - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_mac_pppoe_ipv6_udp_pay_pipeline_mode, False) - - # void input set value - rule_list = self.validate_switch_filter_rule(rules["void input set value"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - rule_list = self.create_switch_filter_rule(rules["void input set value"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - - # invalid port - rule_list = self.validate_switch_filter_rule(rules["invalid port"], check_stats=False) - self.verify(not any(rule_list), "all rules should validate failed, result %s" % rule_list) - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % ([], result)) - result = self.check_switch_filter_rule_list(self.dut_ports[1], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % (rule_list, result)) - rule_list = self.create_switch_filter_rule(rules["invalid port"], check_stats=False) - self.verify(not any(rule_list), "all rules should create failed, result %s" % rule_list) - # check there is no rule listed - result = self.check_switch_filter_rule_list(self.dut_ports[0], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % (rule_list, result)) - result = self.check_switch_filter_rule_list(self.dut_ports[1], is_non_pipeline=False, is_need_rss_rule=False, check_stats=False) - self.verify(result == [], "the rule list is not the same. expect %s, result %s" % (rule_list, result)) - + @skip_unsupported_pkg(['comms', 'wireless']) def test_unsupported_pattern_in_OS_default_package(self): """ Validate and create PPPOE rule, GTPU rule, PFCP rule, l2tpv3 rule, esp rule and ah rule with OS default package @@ -5585,12 +3101,6 @@ class CVLSwitchFilterTest(TestCase): "flow create 0 priority 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 17 / end actions rss queues 2 3 end / end", "flow create 0 priority 0 ingress pattern eth / ipv6 / udp / esp spi is 8 / end actions rss queues 2 3 end / end", "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / ah spi is 1 / end actions queue index 1 / end"] - #bind pf to kernel - self.bind_nics_driver(self.dut_ports, driver="ice") - self.dut.send_expect("cp %s %s" % (self.os_package_location, self.package_location), "# ") - self.re_load_ice_driver() - #bind pf to vfio-pci - self.bind_nics_driver(self.dut_ports, driver="vfio-pci") self.launch_testpmd(False) rule_list = self.validate_switch_filter_rule(rule, check_stats=False) @@ -5607,14 +3117,11 @@ class CVLSwitchFilterTest(TestCase): Run after each test case. """ # destroy all the rules on port 0 - self.dut.send_expect("flow flush %d" % self.dut_ports[0], "testpmd> ", 300) + if self.running_case == "test_unsupported_pattern_in_OS_default_package": + pass + else: + self.dut.send_expect("flow flush %d" % self.dut_ports[0], "testpmd> ", 15) self.dut.send_expect("quit", "#") - if self.running_case == "test_unsupported_pattern_in_OS_default_package": - self.bind_nics_driver(self.dut_ports, driver="ice") - self.dut.send_expect("cp %s %s" % (self.comms_package_location, self.package_location), "# ") - self.re_load_ice_driver() - #bind pf to vfio-pci - self.bind_nics_driver(self.dut_ports, driver="vfio-pci") def tear_down_all(self): """ -- 1.8.3.1