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 B2117A0561; Thu, 18 Mar 2021 06:39:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A66F7141044; Thu, 18 Mar 2021 06:39:55 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6EE9E141043 for ; Thu, 18 Mar 2021 06:39:53 +0100 (CET) IronPort-SDR: T0xTbK99dun1giExnMq0qb8BWx048wlFzg5JoH4oSG4EsKKgjAfB4513Gr5ZA1d/pYi56Syx/P J+AekAX4PVxQ== X-IronPort-AV: E=McAfee;i="6000,8403,9926"; a="176736173" X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="176736173" 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:52 -0700 IronPort-SDR: AnQRT6EvxbnCvzCCOyB1+/fV0y2jEN10sNXZZfdXBCzXkS7zdjsqXdI5w8dVEFl53kfw20Acge xeIu9UtqwRmg== X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="406214321" 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:51 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Thu, 18 Mar 2021 13:27:25 +0800 Message-Id: <1616045251-65532-3-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 2/8] add decorator to 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" *.remove replace pkg step and add pkg check Signed-off-by: Zhimin Huang --- ..._cvl_advanced_iavf_rss_vlan_esp_ah_l2tp_pfcp.py | 82 ++++++++-------------- tests/TestSuite_cvl_fdir.py | 8 ++- tests/TestSuite_iavf_fdir.py | 53 +++++++------- tests/TestSuite_l2tp_esp_coverage.py | 50 ++++++------- 4 files changed, 85 insertions(+), 108 deletions(-) diff --git a/tests/TestSuite_cvl_advanced_iavf_rss_vlan_esp_ah_l2tp_pfcp.py b/tests/TestSuite_cvl_advanced_iavf_rss_vlan_esp_ah_l2tp_pfcp.py index a54dcf5..f7236ee 100644 --- a/tests/TestSuite_cvl_advanced_iavf_rss_vlan_esp_ah_l2tp_pfcp.py +++ b/tests/TestSuite_cvl_advanced_iavf_rss_vlan_esp_ah_l2tp_pfcp.py @@ -32,7 +32,7 @@ import re import random import string import time -from test_case import TestCase +from test_case import TestCase, skip_unsupported_pkg, check_supported_nic from pmd_output import PmdOutput from packet import Packet from rte_flow_common import RssProcessing @@ -831,28 +831,32 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): self.pkt = Packet() self.pmd_output = PmdOutput(self.dut) - self.ddp_dir = "/lib/firmware/updates/intel/ice/ddp/" - conf_file = 'conf/cvl_advanced_rss_pppoe.cfg' - conf_info = UserConf(conf_file) - conf_section = conf_info.conf._sections['suite'] - self.os_default_package = conf_section['os_default_package_file_location'] - self.comms_package = conf_section['comms_package_file_location'] - self.ice_driver = conf_section['ice_driver_file_location'] self.symmetric = False self.rxq = 16 self.rsspro = RssProcessing(self, self.pmd_output, [self.tester_iface0, self.tester_iface1], self.rxq) self.logger.info('rssprocess.tester_ifaces: {}'.format(self.rsspro.tester_ifaces)) self.logger.info('rssprocess.test_case: {}'.format(self.rsspro.test_case)) + self.switch_testpmd(symmetric=self.symmetric) + self.dut_session = self.dut.new_session() def set_up(self): """ Run before each test case. """ - pass + # check testpmd process status + cmd = "ps -aux | grep testpmd | grep -v grep" + out = self.dut_session.send_expect(cmd, "#", 15) + if "testpmd" not in out: + self.switch_testpmd(symmetric=False) + + if self.running_case == "test_unsupported_pattern_with_OS_default_package": + self.dut.kill_all() + self.switch_testpmd(symmetric=True) def create_iavf(self): if self.vf_flag is False: self.dut.bind_interfaces_linux('ice') + self.dut.send_expect("ethtool --set-priv-flags %s vf-vlan-prune-disable on" % self.pf_interface, "# ") self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 1) self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]['vfs_port'] self.vf_flag = True @@ -876,10 +880,10 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): Run after each test case. """ # destroy all flow rule on port 0 - self.dut.send_command("flow flush 0", timeout=1) - self.dut.send_command("clear port stats all", timeout=1) + self.pmd_output.execute_cmd("flow flush 0", timeout=1) + self.pmd_output.execute_cmd("clear port stats all", timeout=1) self.pmd_output.execute_cmd("stop") - self.dut.kill_all() + self.pmd_output.execute_cmd("start") def tear_down_all(self): """ @@ -887,16 +891,7 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): """ self.dut.kill_all() self.destroy_iavf() - - def replace_package(self, package='comms'): - ice_pkg_path = ''.join([self.ddp_dir,"ice.pkg"]) - self.dut.send_expect("rm -f {}".format(ice_pkg_path), "# ") - if package == 'os_default': - self.dut.send_expect("cp {} {}".format(self.os_default_package,ice_pkg_path), "# ") - elif package == 'comms': - self.dut.send_expect("cp {} {}".format(self.comms_package,ice_pkg_path), "# ") - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("insmod {}".format(self.ice_driver), "# ",) + self.dut.send_expect("ethtool --set-priv-flags %s vf-vlan-prune-disable off" % self.pf_interface, "# ") def launch_testpmd(self, symmetric=False): param = "--rxq=16 --txq=16" @@ -919,48 +914,47 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): def _gener_str(self, str_len=6): return ''.join(random.sample(string.ascii_letters + string.digits, k=str_len)) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv4_pfcp_session(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv4_pfcp_session) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv6_pfcp_session(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv6_pfcp_session) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv4_l2tpv3(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv4_l2tpv3) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv6_l2tpv3(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv6_l2tpv3) + @skip_unsupported_pkg("os default") def test_mac_ipv4_esp(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv4_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv4_udp_esp(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv4_udp_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv6_esp(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv6_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv6_udp_esp(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv6_udp_esp) + @skip_unsupported_pkg("os default") def test_mac_ipv4_ah(self): - self.switch_testpmd() self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv4_ah) + @skip_unsupported_pkg('os default') def test_mac_ipv6_ah(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_ipv6_ah) def test_wrong_hash_input_set(self): - self.switch_testpmd(symmetric=False) rule_list = [ 'flow create 0 ingress pattern eth / pppoes / ipv4 / end actions rss types l2-src-only l2-dst-only end key_len 0 queues end / end', 'flow create 0 ingress pattern eth / pppoes / ipv4 / udp / end actions rss types ipv4-tcp end key_len 0 queues end / end', @@ -971,23 +965,18 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): self.rsspro.create_rule(rule, check_stats=False, msg='Invalid argument') def test_void_action(self): - self.switch_testpmd(symmetric=False) rule = 'flow create 0 ingress pattern eth / ipv4 / udp / pfcp / end actions end' self.rsspro.create_rule(rule, check_stats=False, msg='Invalid argument') self.rsspro.check_rule(stats=False, rule_list=[rule]) def test_delete_nonexisting_rule(self): - self.switch_testpmd(symmetric=False) self.rsspro.check_rule(stats=False) out = self.dut.send_command("flow destroy 0 rule 0", timeout=1) self.verify('error' not in out, 'delete nonexisting rule raise err,expected no err') self.dut.send_command("flow flush 0", timeout=1) + @skip_unsupported_pkg(['comms', 'wireless']) def test_unsupported_pattern_with_OS_default_package(self): - self.destroy_iavf() - self.replace_package('os_default') - self.create_iavf() - self.switch_testpmd(symmetric=True) rule_list = [ 'flow create 0 ingress pattern eth / ipv4 / udp / pfcp / end actions rss types pfcp end key_len 0 queues end / end', 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip / end actions rss types l2tpv3 end key_len 0 queues end / end', @@ -997,14 +986,9 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): self.rsspro.create_rule(rule_list, check_stats=False, msg='Invalid argument') self.rsspro.check_rule(stats=False) self.dut.kill_all() - self.destroy_iavf() - self.replace_package('comms') - self.create_iavf() - self.switch_testpmd(symmetric=True) - self.rsspro.create_rule(rule_list, check_stats=True) + self.switch_testpmd(symmetric=False) def test_invalid_port(self): - self.switch_testpmd(symmetric=False) rule = 'flow create 1 ingress pattern eth / ipv4 / udp / pfcp / end actions rss types pfcp end key_len 0 queues end / end' self.rsspro.create_rule(rule, check_stats=False, msg='No such device') self.rsspro.check_rule(stats=False, rule_list=[rule]) @@ -1014,33 +998,25 @@ class Cvl_advance_iavf_rss_vlan_ah_l2tp_pfcp(TestCase): self.verify(result, 'actual result not match expected,expected result is:{}'.format(pattern)) def test_mac_vlan_ipv4_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv4_pay) def test_mac_vlan_ipv4_udp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv4_udp_pay) def test_mac_vlan_ipv4_tcp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv4_tcp_pay) def test_mac_vlan_ipv4_sctp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv4_sctp_pay) def test_mac_vlan_ipv6_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv6_pay) def test_mac_vlan_ipv6_udp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv6_udp_pay) def test_mac_vlan_ipv6_tcp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv6_tcp_pay) def test_mac_vlan_ipv6_sctp_pay(self): - self.switch_testpmd(symmetric=False) self.rsspro.handle_rss_distribute_cases(cases_info=mac_vlan_ipv6_sctp_pay) diff --git a/tests/TestSuite_cvl_fdir.py b/tests/TestSuite_cvl_fdir.py index 549256b..1d41944 100644 --- a/tests/TestSuite_cvl_fdir.py +++ b/tests/TestSuite_cvl_fdir.py @@ -37,7 +37,7 @@ import os from packet import Packet from pmd_output import PmdOutput -from test_case import TestCase +from test_case import TestCase, skip_unsupported_pkg import rte_flow_common as rfc from utils import GREEN, RED @@ -2825,6 +2825,7 @@ class TestCVLFdir(TestCase): out = self.pmd_output.execute_cmd("flow query 0 0 count") self.verify("Flow rule #0 not found" in out, "query should failed") + @skip_unsupported_pkg('os default') def test_multi_patterns_mark_count_query(self): rule1 = 'flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / tcp src is 22 dst is 23 / end actions queue index 1 / mark id 0 / count / end' rule2 = 'flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / udp src is 22 dst is 23 / end actions drop / mark id 1 / count / end' @@ -2943,6 +2944,7 @@ class TestCVLFdir(TestCase): out2 = self.send_pkts_getouput(pkts=pkt, port_id=1) rfc.check_mark(out2, pkt_num=1, check_param={"port_id": 1, "queue": [2, 3], "rss": True}, stats=False) + @skip_unsupported_pkg('os default') def test_two_ports_multi_patterns_count_query(self): rules = [ 'flow create 1 ingress pattern eth / ipv4 dst is 192.168.0.21 proto is 255 tos is 4 / end actions queue index 1 / mark id 1 / count identifier 0x1234 shared on / end', @@ -3161,15 +3163,19 @@ class TestCVLFdir(TestCase): def test_mac_ipv4_tun_mac_ipv4_sctp(self): self._rte_flow_validate(vectors_mac_ipv4_tun_mac_ipv4_sctp) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu_eh(self): self._rte_flow_validate(vectors_mac_ipv4_gtpu_eh) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu(self): self._rte_flow_validate(vectors_mac_ipv4_gtpu) + @skip_unsupported_pkg('os default') def test_mac_ipv6_gtpu_eh(self): self._rte_flow_validate(vectors_mac_ipv6_gtpu_eh) + @skip_unsupported_pkg('os default') def test_mac_ipv6_gtpu(self): self._rte_flow_validate(vectors_mac_ipv6_gtpu) diff --git a/tests/TestSuite_iavf_fdir.py b/tests/TestSuite_iavf_fdir.py index e83855d..a404814 100644 --- a/tests/TestSuite_iavf_fdir.py +++ b/tests/TestSuite_iavf_fdir.py @@ -35,7 +35,7 @@ import time from packet import Packet from pmd_output import PmdOutput -from test_case import TestCase +from test_case import TestCase, skip_unsupported_pkg import rte_flow_common as rfc from rte_flow_common import CVL_TXQ_RXQ_NUMBER from multiprocessing import Process @@ -2234,8 +2234,6 @@ class TestIAVFFdir(TestCase): """ Run before each test case. """ - self.re_load_ice_driver() - time.sleep(1) self.setup_2pf_4vf_env() time.sleep(1) self.launch_testpmd() @@ -2308,16 +2306,6 @@ class TestIAVFFdir(TestCase): self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0]) self.dut.destroy_sriov_vfs_by_port(self.dut_ports[1]) - def re_load_ice_driver(self): - """ - remove and reload the ice driver - """ - self.dut.send_expect("rmmod ice", "# ", 40) - ice_driver_file_location = self.suite_config["ice_driver_file_location"] - self.dut.send_expect("insmod %s" % ice_driver_file_location, "# ") - self.dut.send_expect("ifconfig %s up" % self.pf0_intf, "# ", 15) - self.dut.send_expect("ifconfig %s up" % self.pf1_intf, "# ", 15) - def config_testpmd(self): self.pmd_output.execute_cmd("set fwd rxonly") self.pmd_output.execute_cmd("set verbose 1") @@ -2474,39 +2462,51 @@ class TestIAVFFdir(TestCase): def test_mac_ipv6_sctp(self): self.rte_flow_process(vectors_ipv6_sctp) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu_eh(self): self.rte_flow_process(vectors_ipv4_gtpu_eh) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu(self): self.rte_flow_process(vectors_ipv4_gtpu) + @skip_unsupported_pkg('os default') def test_mac_ipv6_gtpu_eh(self): self.rte_flow_process(vectors_ipv6_gtpu_eh) + @skip_unsupported_pkg('os default') def test_mac_ipv6_gtpu(self): self.rte_flow_process(vectors_ipv6_gtpu) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv4_l2tpv3(self): self.rte_flow_process(vectors_ipv4_l2tpv3) + @skip_unsupported_pkg(['os default', 'wireless']) def test_mac_ipv6_l2tpv3(self): self.rte_flow_process(vectors_ipv6_l2tpv3) + @skip_unsupported_pkg('os default') def test_mac_ipv4_esp(self): self.rte_flow_process(vectors_ipv4_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv6_esp(self): self.rte_flow_process(vectors_ipv6_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv4_ah(self): self.rte_flow_process(vectors_ipv4_ah) + @skip_unsupported_pkg('os default') def test_mac_ipv6_ah(self): self.rte_flow_process(vectors_ipv6_ah) + @skip_unsupported_pkg('os default') def test_mac_ipv4_nat_t_esp(self): self.rte_flow_process(vectors_ipv4_nat_t_esp) + @skip_unsupported_pkg('os default') def test_mac_ipv6_nat_t_esp(self): self.rte_flow_process(vectors_ipv6_nat_t_esp) @@ -2586,6 +2586,7 @@ class TestIAVFFdir(TestCase): out4 = self.send_pkts_getouput(MAC_IPV6_PAY_protocol["match"]) rfc.check_iavf_fdir_mark(out4, pkt_num=6, check_param={"port_id": 0, "passthru": 1}, stats=False) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu_eh_without_teid(self): rules = ["flow create 0 ingress pattern eth / ipv4 / udp / gtpu / gtp_psc / ipv4 / end actions rss types ipv4 end key_len 0 queues end / end", \ "flow create 0 ingress pattern eth / ipv4 / udp / gtpu / gtp_psc qfi is 0x34 / end actions queue index 1 / mark id 3 / end"] @@ -2621,6 +2622,7 @@ class TestIAVFFdir(TestCase): out3 = self.send_pkts_getouput(MAC_IPV4_GTPU_EH_WITHOUT_TEID["match"]) rfc.check_iavf_fdir_mark(out3, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=False) + @skip_unsupported_pkg('os default') def test_mac_ipv4_gtpu_eh_without_qfi(self): rules = ["flow create 0 ingress pattern eth / ipv4 / udp / gtpu / gtp_psc / ipv4 / end actions rss types ipv4 end key_len 0 queues end / end", \ "flow create 0 ingress pattern eth / ipv4 / udp / gtpu teid is 0x12345678 / gtp_psc / end actions rss queues 2 3 end / mark id 1 / end"] @@ -2702,6 +2704,7 @@ class TestIAVFFdir(TestCase): out7 = self.send_pkts_getouput(pkts["mismatch"][7]) rfc.check_iavf_fdir_mark(out7, pkt_num=1, check_param={"port_id": 0, "drop": True}, stats=False) + @skip_unsupported_pkg('os default') def test_mac_outer_co_exist_gtpu_eh_dst(self): rules = ["flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.31 / udp / gtpu / gtp_psc / end actions rss queues 1 2 end / mark id 1 / end", \ "flow create 0 ingress pattern eth / ipv6 dst is ::32 / udp / gtpu / gtp_psc / end actions rss queues 3 4 5 6 end / mark id 2 / end",\ @@ -2733,6 +2736,7 @@ class TestIAVFFdir(TestCase): } self.run_coexist_outer_gtpu(rules, MAC_GTPU_EH) + @skip_unsupported_pkg('os default') def test_mac_outer_co_exist_gtpu_dst(self): rules = ["flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.31 / udp / gtpu / end actions rss queues 1 2 end / mark id 1 / end", \ "flow create 0 ingress pattern eth / ipv6 dst is ::32 / udp / gtpu / end actions rss queues 3 4 5 6 end / mark id 2 / end",\ @@ -2764,6 +2768,7 @@ class TestIAVFFdir(TestCase): } self.run_coexist_outer_gtpu(rules, MAC_GTPU) + @skip_unsupported_pkg('os default') def test_mac_outer_co_exist_gtpu_eh_src(self): rules = ["flow create 0 ingress pattern eth / ipv4 src is 192.168.0.21 / udp / gtpu / gtp_psc / end actions rss queues 1 2 end / mark id 1 / end", \ "flow create 0 ingress pattern eth / ipv6 src is ::12 / udp / gtpu / gtp_psc / end actions rss queues 3 4 5 6 end / mark id 2 / end",\ @@ -2795,6 +2800,7 @@ class TestIAVFFdir(TestCase): } self.run_coexist_outer_gtpu(rules, MAC_GTPU_EH) + @skip_unsupported_pkg('os default') def test_mac_outer_co_exist_gtpu_src(self): rules = ["flow create 0 ingress pattern eth / ipv4 src is 192.168.0.21 / udp / gtpu / end actions rss queues 1 2 end / mark id 1 / end", \ "flow create 0 ingress pattern eth / ipv6 src is ::12 / udp / gtpu / end actions rss queues 3 4 5 6 end / mark id 2 / end",\ @@ -2826,6 +2832,7 @@ class TestIAVFFdir(TestCase): } self.run_coexist_outer_gtpu(rules, MAC_GTPU) + @skip_unsupported_pkg('os default') def test_mac_outer_co_exist_gtpu_mix(self): rules = ["flow create 0 ingress pattern eth / ipv4 src is 192.168.0.21 dst is 192.168.0.31 / udp / gtpu / gtp_psc / end actions rss queues 1 2 end / mark id 1 / end", \ "flow create 0 ingress pattern eth / ipv6 src is ::12 dst is ::32 / udp / gtpu / gtp_psc / end actions rss queues 3 4 5 6 end / mark id 2 / end",\ @@ -2858,6 +2865,7 @@ class TestIAVFFdir(TestCase): self.run_coexist_outer_gtpu(rules, MAC_GTPU_MIX) + @skip_unsupported_pkg(['os default', 'wireless']) def test_pfcp(self): # open the RSS function for PFCP session packet. out = self.pmd_output.execute_cmd("flow create 0 ingress pattern eth / ipv4 / udp / pfcp / end actions rss types pfcp end key_len 0 queues end / end") @@ -2866,6 +2874,7 @@ class TestIAVFFdir(TestCase): self.verify("Flow rule #1 created" in out, "failed to enable RSS function for MAC_IPV6_PFCP session packet") self.multirules_process(vectors_pfcp) + @skip_unsupported_pkg('os default') def test_l2_ethertype(self): self.multirules_process(vectors_l2_ethertype) @@ -2955,6 +2964,7 @@ class TestIAVFFdir(TestCase): self.check_fdir_rule(port_id=0, stats=False) self.check_fdir_rule(port_id=1, stats=False) + @skip_unsupported_pkg(['comms', 'wireless']) def test_unsupported_pattern_with_OS_package(self): """ Create GTPU rule, PFCP rule, L2 Ethertype rule, l2tpv3 rule and esp rule with OS default package @@ -2964,24 +2974,11 @@ class TestIAVFFdir(TestCase): "flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 1 / mark id 1 / end", "flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 17 / end actions rss queues 1 2 end / mark id 6 / end", "flow create 0 ingress pattern eth / ipv6 / udp / esp spi is 6 / end actions rss queues 1 2 end / mark id 6 / end"] - self.destroy_env() - os_package_location = self.suite_config["os_default_package_file_location"] - comms_package_location = self.suite_config["comms_package_file_location"] - package_location = self.suite_config["package_file_location"] - self.dut.send_expect("cp %s %s" % (os_package_location, package_location), "# ") - self.re_load_ice_driver() - self.setup_2pf_4vf_env() self.launch_testpmd() - self.validate_fdir_rule(rule, check_stats=False) self.create_fdir_rule(rule, check_stats=False) self.check_fdir_rule(port_id=0, stats=False) - self.destroy_env() - self.dut.send_expect("cp %s %s" % (comms_package_location, package_location), "# ") - self.re_load_ice_driver() - self.setup_2pf_4vf_env() - def test_create_same_rule_on_pf_vf(self): """ create same rules on pf and vf, no conflict @@ -3441,6 +3438,7 @@ class TestIAVFFdir(TestCase): self.dut.close_session(self.session_secondary) self.dut.close_session(self.session_third) + @skip_unsupported_pkg(['os default', 'wireless']) def test_maxnum_128_profiles(self): """ There are 128 profiles in total. @@ -3883,6 +3881,7 @@ class TestIAVFFdir(TestCase): vlans.append(vlan) return vlans + @skip_unsupported_pkg(['os default', 'wireless']) def test_pfcp_vlan_strip_on_hw_checksum(self): """ Set PFCP FDIR rules @@ -3979,6 +3978,7 @@ class TestIAVFFdir(TestCase): self.verify(bad_ipcsum == 2, "Bad-ipcsum check error") self.verify(bad_l4csum == 4, "Bad-l4csum check error") + @skip_unsupported_pkg(['os default', 'wireless']) def test_pfcp_vlan_strip_off_sw_checksum(self): """ Set PFCP FDIR rules @@ -4073,6 +4073,7 @@ class TestIAVFFdir(TestCase): self.verify(bad_ipcsum == 2, "Bad-ipcsum check error") self.verify(bad_l4csum == 4, "Bad-l4csum check error") + @skip_unsupported_pkg(['os default', 'wireless']) def test_pfcp_vlan_insert_on(self): """ Set PFCP FDIR rules diff --git a/tests/TestSuite_l2tp_esp_coverage.py b/tests/TestSuite_l2tp_esp_coverage.py index 89f7cae..10520c8 100644 --- a/tests/TestSuite_l2tp_esp_coverage.py +++ b/tests/TestSuite_l2tp_esp_coverage.py @@ -33,7 +33,7 @@ import re import time from packet import Packet from pmd_output import PmdOutput -from test_case import TestCase +from test_case import TestCase, skip_unsupported_pkg, check_supported_nic import rte_flow_common as rfc vf0_mac = "00:11:22:33:44:55" @@ -76,9 +76,10 @@ tv_MAC_IPV6_NAT_T_ESP_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IPv 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IPv6()/UDP(dport=4500)/ESP(spi=1)/Raw('x'*480)" % vf0_mac, 'no vlan': "Ether(dst='%s')/IPv6()/UDP(dport=4500)/ESP(spi=1)/Raw('x'*480)" % vf0_mac} - class L2tpEspCoverage(TestCase): + supported_nic = ['columbiaville_100g', 'columbiaville_25g', 'columbiaville_25gx2'] + @check_supported_nic(supported_nic) def set_up_all(self): """ Run at the start of each test suite. @@ -95,7 +96,6 @@ class L2tpEspCoverage(TestCase): self.pf_interface = self.dut.ports_info[self.dut_ports[0]]['intf'] self.pf_mac = self.dut.get_mac_address(0) self.pf_pci = self.dut.ports_info[self.dut_ports[0]]['pci'] - self.verify(self.nic in ["columbiaville_25g", "columbiaville_100g"], "%s nic not support ethertype filter" % self.nic) self.vf_flag = False self.create_iavf() self.pkt = Packet() @@ -104,6 +104,7 @@ class L2tpEspCoverage(TestCase): """ Run before each test case. """ + cases_list = ["test_MAC_IPV4_L2TPv3_HW_checksum_vlan_strip", "test_MAC_IPV4_L2TPv3_SW_checksum_vlan_insertion"] self.dut.kill_all() def tear_down(self): @@ -156,21 +157,12 @@ class L2tpEspCoverage(TestCase): self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) - def enable_hw_checksum(self): - self.dut.send_expect("stop","testpmd> ") - self.dut.send_expect("port stop all","testpmd> ") - self.dut.send_expect("csum set ip hw 0","testpmd> ") - self.dut.send_expect("csum set udp hw 0","testpmd> ") - self.dut.send_expect("port start all","testpmd> ") - self.dut.send_expect("set fwd csum","testpmd> ") - self.dut.send_expect("set verbose 1","testpmd> ") - self.dut.send_expect("start","testpmd> ") - - def enable_sw_checksum(self): + def enable_checksum(self, param_type="hw"): + self.dut.send_expect("stop","testpmd> ") self.dut.send_expect("port stop all","testpmd> ") - self.dut.send_expect("csum set ip sw 0","testpmd> ") - self.dut.send_expect("csum set udp sw 0","testpmd> ") + self.dut.send_expect("csum set ip %s 0" % param_type,"testpmd> ") + self.dut.send_expect("csum set udp %s 0" % param_type,"testpmd> ") self.dut.send_expect("port start all","testpmd> ") self.dut.send_expect("set fwd csum","testpmd> ") self.dut.send_expect("set verbose 1","testpmd> ") @@ -221,30 +213,29 @@ class L2tpEspCoverage(TestCase): def test_MAC_IPV4_L2TPv3_HW_checksum(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) - self.enable_hw_checksum() + self.enable_checksum() self.checksum_verify(tv_MAC_IPV4_L2TPv3_chksum) def test_MAC_IPV4_ESP_HW_checksum(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) - self.enable_hw_checksum() + self.enable_checksum() self.checksum_verify(tv_MAC_IPV4_ESP_chksum) def test_MAC_IPV4_AH_HW_checksum(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) - self.enable_hw_checksum() + self.enable_checksum() self.checksum_verify(tv_MAC_IPV4_AH_chksum) def test_MAC_IPV4_NAT_T_ESP_HW_checksum(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) - self.enable_hw_checksum() + self.enable_checksum() self.checksum_verify(tv_MAC_IPV4_NAT_T_ESP_chksum) def test_MAC_IPV6_NAT_T_ESP_HW_checksum(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) - self.enable_hw_checksum() + self.enable_checksum() self.checksum_verify(tv_MAC_IPV6_NAT_T_ESP_chksum) - - + def start_tcpdump(self, rxItf): self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "#") self.tester.send_expect("tcpdump -A -nn -e -vv -w getPackageByTcpdump.cap -i %s 2> /dev/null& " % rxItf, "#") @@ -358,6 +349,7 @@ class L2tpEspCoverage(TestCase): tx_port = self.tx_iface self.pkt.send_pkt(crb=self.tester, tx_port=tx_port) + @skip_unsupported_pkg(['os default', 'wireless']) def test_MAC_IPV4_L2TPv3_HW_checksum_vlan_strip(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) @@ -366,7 +358,7 @@ class L2tpEspCoverage(TestCase): self.dut.send_expect("vlan set strip on 0","testpmd> ") self.dut.send_expect("rx_vlan add 1 0","testpmd> ") - self.enable_hw_checksum() + self.enable_checksum() #create rule self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1 / end actions queue index 1 / mark id 4 / end","testpmd> ") self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 2 / end actions queue index 2 / mark id 3 / end","testpmd> ") @@ -415,6 +407,7 @@ class L2tpEspCoverage(TestCase): receive_pkt = re.findall('vlan 1', tcpdump_out) self.verify(len(receive_pkt) == 1, 'vlan id strip on failed') + @skip_unsupported_pkg(['os default', 'wireless']) def test_MAC_IPV4_L2TPv3_SW_checksum_vlan_insertion(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) @@ -446,7 +439,7 @@ class L2tpEspCoverage(TestCase): receive_pkt = re.findall('vlan 1', tcpdump_out) self.verify(len(receive_pkt) == 1, 'vlan insertion failed') - self.enable_sw_checksum() + self.enable_checksum("sw") # bad checksum + mismatched session id pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) @@ -468,8 +461,8 @@ class L2tpEspCoverage(TestCase): # check the rx checksum bad_ipcsum = self.pmd_output.get_pmd_value("Bad-ipcsum:", out) self.verify(bad_ipcsum == 1, "bad ip csum check error") - + @skip_unsupported_pkg('os default') def test_MAC_IPV4_ESP_HW_checksum_vlan_strip(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) @@ -478,7 +471,7 @@ class L2tpEspCoverage(TestCase): self.dut.send_expect("vlan set strip on 0","testpmd> ") self.dut.send_expect("rx_vlan add 1 0","testpmd> ") - self.enable_hw_checksum() + self.enable_checksum() #create rule self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / esp spi is 1 / end actions queue index 1 / mark id 4 / end","testpmd> ") self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / esp spi is 2 / end actions queue index 2 / mark id 3 / end","testpmd> ") @@ -527,6 +520,7 @@ class L2tpEspCoverage(TestCase): receive_pkt = re.findall('vlan 1', tcpdump_out) self.verify(len(receive_pkt) == 1, 'vlan id strip on failed') + @skip_unsupported_pkg('os default') def test_MAC_IPV4_NAT_T_ESP_SW_checksum_vlan_insertion(self): self.create_testpmd_command(self.vf0_prop,rx_checksum=1) @@ -557,7 +551,7 @@ class L2tpEspCoverage(TestCase): receive_pkt = re.findall('vlan 1', tcpdump_out) self.verify(len(receive_pkt) == 1, 'vlan insertion failed') - self.enable_sw_checksum() + self.enable_checksum("sw") # bad checksum + mismatched session id pkts="Ether(dst='00:11:22:33:44:55')/IP(chksum=0x123)/UDP(dport=4500)/ESP(spi=11)/Raw('x'*480)" self.start_tcpdump(self.tx_iface) -- 1.8.3.1