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 9C1D6A0093; Mon, 7 Mar 2022 12:49:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AE5540688; Mon, 7 Mar 2022 12:49:37 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 188B64014E for ; Mon, 7 Mar 2022 12:49:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646653776; x=1678189776; h=from:to:cc:subject:date:message-id; bh=qZeKYubRTsLdiA2xL+FkX+w3V0mSZEhSJnuSqECf+8g=; b=Zdkdmp5PgWsPcSvVPaCA+rbRAjwGmWvg6/L+HJc/F2hHedvtr9MdTatO AIiR39sf0wroxmCqYJ+ZA+uxYObGtgOypTU3e6oXPF0y0EFPwFKqXEXIV 9nrjV2BA2uftH9hj7w2WrfPc9ivZCNyyf+z3cGAmswMEWNgXFtKz/HiZs h5MkZKinTMqmXiN5KgE5liZbF9Wr9NgM5+3Nshm9UOdkKKYupiE4rAMkT 126cP7FMATnmeLL7f4vOmtsi4YJ3SHE13WJiXbBTSP3Wr7MFgkvEwsg8w rBcno74iVhCSQZZpfhSW29745TXud9IIYXVY6rixs4+bdph9QqO02wBl0 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="234326585" X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="234326585" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 03:49:34 -0800 X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="537084112" Received: from unknown (HELO localhost.localdomain) ([10.239.251.203]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 03:49:33 -0800 From: Peng Zhang To: dts@dpdk.org Cc: Peng Zhang Subject: [dts][PATCH V2 1/2] delete test cases related mirroring because dpdk removed related function Date: Tue, 8 Mar 2022 04:07:16 +0800 Message-Id: <20220307200717.8456-1-peng1x.zhang@intel.com> X-Mailer: git-send-email 2.17.1 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 Delete test cases related mirroring because dpdk removed related function. dpdk commit-id: b225783dda ethdev: remove legacy mirroring API Signed-off-by: Peng Zhang --- tests/TestSuite_sriov_kvm.py | 428 ----------------------------------- 1 file changed, 428 deletions(-) diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py index d9f239e3..64247def 100644 --- a/tests/TestSuite_sriov_kvm.py +++ b/tests/TestSuite_sriov_kvm.py @@ -438,73 +438,6 @@ class TestSriovKvm(TestCase): if not self.port_mirror_ref[port]: self.port_mirror_ref.pop(port) - def set_port_mirror_rule(self, port, mirror_name, rule_detail): - """ - Set the mirror rule for specified port. - """ - port = self.transform_integer(port) - - rule_id = self.make_port_new_ruleid(port) - - mirror_rule_cmd = "set port %d mirror-rule %d %s %s" % \ - (port, rule_id, mirror_name, rule_detail) - out = self.dut.send_expect("%s" % mirror_rule_cmd, "testpmd> ") - self.verify('Bad arguments' not in out, "Set port %d %s failed!" % - (port, mirror_name)) - - self.add_port_ruleid(port, rule_id) - return rule_id - - def set_port_pool_mirror(self, port, pool_mirror_rule): - """ - Set the pool mirror for specified port. - """ - return self.set_port_mirror_rule(port, 'pool-mirror-up', pool_mirror_rule) - - def set_port_vlan_mirror(self, port, vlan_mirror_rule): - """ - Set the vlan mirror for specified port. - """ - return self.set_port_mirror_rule(port, 'vlan-mirror', vlan_mirror_rule) - - def set_port_uplink_mirror(self, port, uplink_mirror_rule): - """ - Set the uplink mirror for specified port. - """ - return self.set_port_mirror_rule(port, 'uplink-mirror', uplink_mirror_rule) - - def set_port_downlink_mirror(self, port, downlink_mirror_rule): - """ - Set the downlink mirror for specified port. - """ - return self.set_port_mirror_rule(port, 'downlink-mirror', downlink_mirror_rule) - - def reset_port_mirror_rule(self, port, rule_id): - """ - Reset the pool mirror for specified port. - """ - port = self.transform_integer(port) - rule_id = self.transform_integer(rule_id) - - mirror_rule_cmd = "reset port %d mirror-rule %d" % (port, rule_id) - out = self.dut.send_expect("%s" % mirror_rule_cmd, "testpmd> ") - self.verify("Bad arguments" not in out, - "Reset port %d mirror rule failed!") - - self.remove_port_ruleid(port, rule_id) - - def reset_port_all_mirror_rule(self, port): - """ - Reset all mirror rules of specified port. - """ - port = self.transform_integer(port) - - if port not in list(self.port_mirror_ref.keys()): - pass - else: - for rule_id in self.port_mirror_ref[port][:]: - self.reset_port_mirror_rule(port, rule_id) - def setup_two_vm_common_prerequisite(self, fwd0="rxonly", fwd1="mac"): if self.setup_2vm_prerequisite_flag == 1: @@ -592,339 +525,6 @@ class TestSriovKvm(TestCase): ret_stats[key] = end_stats[key] - start_stats[key] return ret_stats - def test_two_vms_pool_up_mirrors(self): - """ - Test Case2: Mirror Traffic between 2VMs with Pool up mirroring - """ - port_id_0 = 0 - packet_num = 10 - - # set Pool up mirror rule - rule_id = self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 on') - - # get vm1 port stats - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send 10 packets - self.send_packet( - self.vm_dut_0, self.vm0_dut_ports, port_id_0, count=packet_num) - - # get vm1 port stats - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - self.verify(vm1_ret_stats['RX-packets'] == packet_num and vm1_ret_stats['TX-packets'] == packet_num, - "Pool up mirror failed between VM0 and VM1!") - - def test_two_vms_pool_down_mirrors(self): - """ - Test Case3: Mirror Traffic between 2VMs with Pool down mirroring - """ - port_id_0 = 0 - mirror_name = "pool-mirror-down" - packet_num = 32 - - # set up common 2VM prerequisites - self.setup_two_vm_common_prerequisite(fwd0="mac", fwd1="rxonly") - - # set Pool down mirror rule - rule_id = self.set_port_mirror_rule(port_id_0, mirror_name, '0x1 dst-pool 1 on') - - # get vm port stats - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('start tx_first') - - # get vm port stats - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] == vm0_ret_stats['TX-packets'] and vm1_ret_stats['RX-packets'] == packet_num, - "Pool down mirror failed between VM0 and VM1!") - - def test_two_vms_uplink_mirror(self): - """ - Test Case4: Mirror Traffic between 2VMs with Uplink mirroring - """ - port_id_0 = 0 - packet_num = 10 - - # set uplink mirror rule - rule_id = self.set_port_uplink_mirror(port_id_0, 'dst-pool 1 on') - - # get vm1 port stats - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - self.send_packet( - self.vm_dut_0, self.vm0_dut_ports, port_id_0, count=packet_num) - - # get vm1 port stats - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] >= packet_num and vm1_ret_stats['TX-packets'] >= packet_num, - "Uplink mirror failed between VM0 and VM1!") - - def test_two_vms_downlink_mirror(self): - """ - Test Case5: Mirror Traffic between 2VMs with Downlink mirroring - """ - port_id_0 = 0 - packet_num = 32 - - # set downlink mirror rule - rule_id = self.set_port_downlink_mirror(port_id_0, 'dst-pool 1 on') - - # set up common 2VM prerequisites - self.setup_two_vm_common_prerequisite(fwd0="mac", fwd1="rxonly") - - # get vms port stats - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('start tx_first') - - # get vms port stats - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] == vm0_ret_stats['TX-packets'] and vm1_ret_stats['RX-packets'] == packet_num, - "Downlink mirror failed between VM0 and VM1!") - - def test_two_vms_vlan_mirror(self): - """ - Test Case6: Mirror Traffic between 2VMs with Vlan mirroring - """ - port_id_0 = 0 - vlan_id = random.randint(1, 4095) - vf_mask = '0x1' - packet_num = 10 - - # set up common 2VM prerequisites - self.setup_two_vm_common_prerequisite(fwd0="mac", fwd1="rxonly") - - # add rx vlan on VF0 - self.host_testpmd.execute_cmd('rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, vf_mask)) - - # set vlan mirror rule - rule_id = self.set_port_vlan_mirror(port_id_0, '%d dst-pool 1 on' % vlan_id) - - # get vm port stats - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - ether_ip = {} - ether_ip['vlan'] = {'vlan': '%d' % vlan_id} - self.send_packet( - self.vm_dut_0, - self.vm0_dut_ports, - port_id_0, - count=packet_num, - **ether_ip) - - # get vm port stats - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # reset pf vlan - self.host_testpmd.execute_cmd('rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, vf_mask)) - - # verify vm1 receive packets - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] == packet_num * 2, "Vlan mirror failed between VM0 and VM1!") - - def test_two_vms_vlan_and_pool_mirror(self): - self.setup_2vm_prerequisite_flag = 0 - self.vm0_testpmd.execute_cmd('vlan set strip on 0') - self.vm1_testpmd.execute_cmd('vlan set strip on 0') - port_id_0 = 0 - vlan_id = 3 - vf_mask = '0x2' - packet_num = 10 - - self.host_testpmd.execute_cmd( - 'rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, vf_mask)) - self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 on') - self.set_port_vlan_mirror(port_id_0, '%d dst-pool 0 on' % vlan_id) - - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - self.send_packet( - self.vm_dut_0, - self.vm0_dut_ports, - port_id_0, - count=packet_num) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] == packet_num and - vm1_ret_stats['TX-packets'] == packet_num, - "Pool mirror failed between VM0 and VM1 when set vlan and pool mirror!") - - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - ether_ip = {} - ether_ip['vlan'] = {'vlan': '%d' % vlan_id} - self.send_packet( - self.vm_dut_1, - self.vm1_dut_ports, - port_id_0, - count=10 * - packet_num, - **ether_ip) - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - - self.host_testpmd.execute_cmd( - 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, vf_mask)) - self.reset_port_all_mirror_rule(port_id_0) - self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX-packets'], 10 * packet_num), - "Vlan mirror failed between VM0 and VM1 when set vlan and pool mirror!") - - def test_two_vms_uplink_and_downlink_mirror(self): - """ - Test Case7: Mirror Traffic between 2VMs with up link mirroring & down link mirroring - """ - port_id_0 = 0 - packet_num = 10 - - # set up common 2VM prerequisites - self.setup_two_vm_common_prerequisite(fwd0="mac", fwd1="rxonly") - - # set mirror rule - self.set_port_downlink_mirror(port_id_0, 'dst-pool 1 on') - self.set_port_uplink_mirror(port_id_0, 'dst-pool 1 on') - - # get vm1 port stats - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - self.send_packet(self.vm_dut_0, self.vm0_dut_ports, port_id_0, count=packet_num) - - # get vm1 port stats - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - try: - self.verify(vm1_ret_stats['RX-packets'] == packet_num * 2, "failed") - except: - self.reset_port_all_mirror_rule(port_id_0) - raise ("Set uplink and downlink mirror failed!") - - def test_two_vms_vlan_and_pool_and_uplink_and_downlink(self): - """ - Test Case8: Mirror Traffic between 2VMs with Vlan & with up link mirroring & down link mirroring - """ - port_id_0 = 0 - vlan_id = random.randint(1, 4095) - vf_mask = '0x2' - packet_num = 1 - - # set up common 2VM prerequisites - self.setup_two_vm_common_prerequisite(fwd0="mac", fwd1="rxonly") - - # set mirror rule - self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 on') - self.set_port_downlink_mirror(port_id_0, 'dst-pool 1 on') - - if self.nic.startswith('niantic') or self.nic.startswith('sage') or self.nic.startswith('twinpond'): - self.set_port_uplink_mirror(port_id_0, 'dst-pool 1 on') - - # get vm port stats - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - - # send packets - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('set fwd rxonly') - self.vm0_testpmd.execute_cmd('start tx_first') - - # get vm port stats - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - self.verify(vm1_ret_stats['RX-packets'] == vm0_ret_stats['TX-packets'], "uplink &downlink mirror failed between VM0 and VM1") - - # set vlan mirror rule - self.host_testpmd.execute_cmd("rx_vlan add %d port %d vf %s" % (vlan_id, port_id_0, vf_mask)) - self.set_port_vlan_mirror(port_id_0, '%d dst-pool 0 on' % vlan_id) - - # get vm port stats - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # send packets - ether_ip = {} - ether_ip['vlan'] = {'vlan': '%d' % vlan_id} - self.send_packet( - self.vm_dut_1, - self.vm1_dut_ports, - port_id_0, - count=packet_num, - **ether_ip) - # get vm port stats - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # verify vm1 receive packets - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - - try: - if self.nic.startswith('niantic') or self.nic.startswith('sage') or self.nic.startswith('twinpond'): - self.verify(vm0_ret_stats['RX-packets'] == packet_num and vm1_ret_stats['RX-packets'] == packet_num, - "vlan mirror failed between VM0 and VM1") - else: - self.verify(vm0_ret_stats['RX-packets'] == packet_num and vm1_ret_stats['RX-packets'] == 2 * packet_num, - "vlan&downlink mirror failed between VM0 and VM1") - except: - self.host_testpmd.execute_cmd("rx_vlan rm %d port %d vf %s" % (vlan_id, port_id_0, vf_mask)) - raise ("vlan mirror or downlink mirror failed between VM0 and VM1") - - # get vm port stats - vm0_start_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - # send packets - self.send_packet( - self.vm_dut_0, - self.vm0_dut_ports, - port_id_0, - count=packet_num) - # get vm port stats - vm0_end_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vm1_end_stats = self.vm1_testpmd.get_pmd_stats(port_id_0) - - # reset pf vlan - self.host_testpmd.execute_cmd("rx_vlan rm %d port %d vf %s" % (vlan_id, port_id_0, vf_mask)) - - # verify vm1 receive packets - vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats) - vm1_ret_stats = self.calculate_stats(vm1_start_stats, vm1_end_stats) - self.verify(vm0_ret_stats['RX-packets'] == packet_num and vm1_ret_stats['RX-packets'] == packet_num, - "uplink mirror failed between VM0 and VM1") - def test_two_vms_add_multi_exact_mac_on_vf(self): port_id_0 = 0 vf_num = 0 @@ -1182,36 +782,8 @@ class TestSriovKvm(TestCase): "Disable RX broadcast failed between VM0 and VM1 " + "when enable or pause TX queues on VF!") - def test_two_vms_negative_input_commands(self): - for command in ["set port 0 vf 65 tx on", - "set port 2 vf -1 tx off", - "set port 0 vf 0 rx oneee", - "set port 0 vf 0 rx offdd", - "set port 0 vf 64 rxmode BAM on", - "set port 0 vf 64 rxmode BAM off", - "set port 0 uta 00:11:22:33:44 on", - "set port 7 uta 00:55:44:33:22:11 off", - "set port 0 vf 34 rxmode ROPE on", - "mac_addr add port 0 vf 65 00:55:44:33:22:11", - "mac_addr add port 5 vf 0 00:55:44:88:22:11", - "set port 0 mirror-rule 256 uplink-mirror dst-pool 1 on", - "set port 0 mirror-rule 0 downlink-mirror 0xf dst-pool 2 off", - "reset port 0 mirror-rule 4", - "reset port 0xff mirror-rule 0"]: - output = self.host_testpmd.execute_cmd(command) - error = False - - for error_regx in [r'Bad', r'bad', r'failed', r'-[0-9]+', r'error', r'Invalid']: - ret_regx = re.search(error_regx, output) - if ret_regx and ret_regx.group(): - error = True - break - self.verify( - error, "Execute command '%s' successfully, it should be failed!" % command) - def tear_down(self): port_id_0 = 0 - self.reset_port_all_mirror_rule(port_id_0) self.vm0_testpmd.execute_cmd('clear port stats all') self.vm1_testpmd.execute_cmd('clear port stats all') self.vm0_testpmd.execute_cmd('stop') -- 2.17.1