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 28570429EA; Tue, 25 Apr 2023 12:01:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D66B40ED6; Tue, 25 Apr 2023 12:01:03 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 3F4B040395 for ; Tue, 25 Apr 2023 12:01:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682416861; x=1713952861; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RFlq7/4Zn584QRyI8QxjPX3o8UqvD9GpGzoNoOv+H6E=; b=m5HokwXpLxm6RT4CMscHdGv5got8LRsZc2SKGeE0Nx8EKMdATWgb5Tkm P/Hpu8q74l1T0pSTIE7+b/8/quuAnlMGfbYBiMfL7oMF9k/EYVozG8AUZ jSEkps3kfDYHK0+tkPAPUYYgnV59j7+0n2P0yc2NdfROdEQQjna9lbnoM 9gGNWdK5+w8nvlY7OfezWv/9m43fN9O9VZxJTOURxNdAmONP6dgfiX8D+ +a7bt/jZzZYtTPFbjXuH98Jbj+wBa9yr/gDYg5MQfVJvJJ+jWs8YSs4o/ afSnsA3QJImi+u3LWBuQyqkdPMESsvDt+e4RcMTymdks7vKca5+aDzDZd w==; X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="349509784" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="349509784" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 03:01:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="762791156" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="762791156" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 03:00:58 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2] tests/pvp_qemu_multi_paths_port_restart: add expected value in suite config file to verify Date: Tue, 25 Apr 2023 17:59:06 +0800 Message-Id: <20230425095906.3019431-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 1.Optimize the verify the expected value from the hard code to read from conf/pvp_qemu_multi_paths_port_restart.cfg to adapt different platform. 2.Add new conf/pvp_qemu_multi_paths_port_restart.cfg to save the test parameters and expected vaule to verify running vaule. Signed-off-by: Wei Ling --- conf/pvp_qemu_multi_paths_port_restart.cfg | 63 +++ ...Suite_pvp_qemu_multi_paths_port_restart.py | 368 +++++++++++++----- 2 files changed, 339 insertions(+), 92 deletions(-) create mode 100644 conf/pvp_qemu_multi_paths_port_restart.cfg diff --git a/conf/pvp_qemu_multi_paths_port_restart.cfg b/conf/pvp_qemu_multi_paths_port_restart.cfg new file mode 100644 index 00000000..53e737bd --- /dev/null +++ b/conf/pvp_qemu_multi_paths_port_restart.cfg @@ -0,0 +1,63 @@ +[vm0] +cpu = + model=host,number=8,cpupin=20 21 22 23 24 25 26 27; +mem = + size=8192,hugepage=yes; +disk = + file=/home/image/ubuntu2004.img; +login = + user=root,password=tester; +vnc = + displayNum=4; +daemon = + enable=yes; +qemu = + path=/home/QEMU/qemu-7.2.0/bin/qemu-system-x86_64; + +[suite] +update_expected = True +packet_sizes = [64, 128, 256, 512, 1024, 1280, 1518] +test_duration = 30 +accepted_tolerance = 5 +expected_throughput = { + 'test_perf_pvp_qemu_mergeable_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_mergeable_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_normal_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_normal_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_vector_rx_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_vector_rx_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_mergeable_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_mergeable_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_normal_path': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_normal_path_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_vector_rx_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_vector_rx_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_mergeable_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_mergeable_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_normal_path': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_normal_path_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_vector_rx_mac': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_with_virtio_11_vector_rx_mac_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_mergeable_mac_restart_10_times': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}, + 'test_perf_pvp_qemu_modern_mergeable_mac_restart_10_times_restart_port': + {64: 0.00, 128: 0.00, 256: 0.00, 512: 0.00, 1024: 0.00, 1280: 0.00, 1518: 0.00}} + diff --git a/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py b/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py index 64661a1e..531d9fca 100644 --- a/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py +++ b/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py @@ -4,10 +4,12 @@ import re import time +from copy import deepcopy from framework.packet import Packet from framework.pktgen import PacketGeneratorHelper from framework.pmd_output import PmdOutput +from framework.settings import HEADER_SIZE, UPDATE_EXPECTED, load_global_setting from framework.test_case import TestCase from framework.virt_common import VM @@ -18,6 +20,12 @@ class TestPVPQemuMultiPathPortRestart(TestCase): Run at the start of each test suite. """ self.frame_sizes = [64, 128, 256, 512, 1024, 1280, 1518] + self.logger.info( + "You can config packet_size in file %s.cfg," % self.suite_name + + " in region 'suite' like packet_sizes=[64, 128, 256]" + ) + if "packet_sizes" in self.get_suite_cfg(): + self.frame_sizes = self.get_suite_cfg()["packet_sizes"] self.core_config = "1S/3C/1T" self.dut_ports = self.dut.get_ports() self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") @@ -37,7 +45,8 @@ class TestPVPQemuMultiPathPortRestart(TestCase): # create an instance to set stream field setting self.pktgen_helper = PacketGeneratorHelper() self.pci_info = self.dut.ports_info[0]["pci"] - self.number_of_ports = 1 + self.nb_ports = 1 + self.gap = self.get_suite_cfg()["accepted_tolerance"] self.path = self.dut.apps_name["test-pmd"] self.testpmd_name = self.path.split("/")[-1] self.vhost_user = self.dut.new_session(suite="vhost-user") @@ -51,15 +60,8 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#") - # Prepare the result table - self.table_header = [ - "FrameSize(B)", - "Mode", - "Throughput(Mpps)", - "% linerate", - "Cycle", - ] - self.result_table_create(self.table_header) + self.throughput = dict() + self.test_result = dict() def start_vhost_testpmd(self): """ @@ -107,7 +109,7 @@ class TestPVPQemuMultiPathPortRestart(TestCase): """ start qemu """ - self.vm = VM(self.dut, "vm0", "vhost_sample") + self.vm = VM(self.dut, "vm0", self.suite_name) vm_params = {} vm_params["driver"] = "vhost-user" vm_params["opt_path"] = "%s/vhost-net" % self.base_dir @@ -172,81 +174,102 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.check_port_link_status_after_port_restart() self.vhost_user_pmd.execute_cmd("start") - def update_table_info(self, case_info, frame_size, Mpps, throughtput, Cycle): - results_row = [frame_size] - results_row.append(case_info) - results_row.append(Mpps) - results_row.append(throughtput) - results_row.append(Cycle) - self.result_table_add(results_row) - - @property - def check_value(self): - check_dict = dict.fromkeys(self.frame_sizes) - linerate = { - 64: 0.075, - 128: 0.10, - 256: 0.10, - 512: 0.20, - 1024: 0.35, - 1280: 0.40, - 1518: 0.45, - } - for size in self.frame_sizes: - speed = self.wirespeed(self.nic, size, self.number_of_ports) - check_dict[size] = round(speed * linerate[size], 2) - return check_dict - - def calculate_avg_throughput(self, frame_size): + def perf_test(self): """ start to send packet and get the throughput """ - pkt = Packet(pkt_type="IP_RAW", pkt_len=frame_size) - pkt.config_layer("ether", {"dst": "%s" % self.dst_mac}) - pkt.save_pcapfile(self.tester, "%s/pvp_multipath.pcap" % (self.out_path)) - - tgenInput = [] - port = self.tester.get_local_port(self.dut_ports[0]) - tgenInput.append((port, port, "%s/pvp_multipath.pcap" % self.out_path)) - self.tester.pktgen.clear_streams() - streams = self.pktgen_helper.prepare_stream_from_tginput( - tgenInput, 100, None, self.tester.pktgen - ) - # set traffic option - traffic_opt = {"delay": 5} - _, pps = self.tester.pktgen.measure_throughput( - stream_ids=streams, options=traffic_opt - ) - Mpps = pps / 1000000.0 - self.verify( - Mpps > self.check_value[frame_size], - "%s of frame size %d speed verify failed, expect %s, result %s" - % (self.running_case, frame_size, self.check_value[frame_size], Mpps), - ) - throughput = Mpps * 100 / float(self.wirespeed(self.nic, frame_size, 1)) - return Mpps, throughput - - def send_and_verify(self, case_info): - """ - start to send packets and verify it - """ + # Prepare the result table + self.table_header = [ + "FrameSize(B)", + "Throughput(Mpps)", + "% linerate", + ] + self.result_table_create(self.table_header) + self.throughput = {} for frame_size in self.frame_sizes: info = "Running test %s, and %d frame size." % ( self.running_case, frame_size, ) self.logger.info(info) - - Mpps, throughput = self.calculate_avg_throughput(frame_size) - self.update_table_info( - case_info, frame_size, Mpps, throughput, "Before Restart" + pkt = Packet(pkt_type="IP_RAW", pkt_len=frame_size) + pkt.config_layer("ether", {"dst": "%s" % self.dst_mac}) + pkt.save_pcapfile(self.tester, "%s/pvp_multipath.pcap" % (self.out_path)) + + tgenInput = [] + port = self.tester.get_local_port(self.dut_ports[0]) + tgenInput.append((port, port, "%s/pvp_multipath.pcap" % self.out_path)) + self.tester.pktgen.clear_streams() + streams = self.pktgen_helper.prepare_stream_from_tginput( + tgenInput, 100, None, self.tester.pktgen ) - - self.port_restart() - Mpps, throughput = self.calculate_avg_throughput(frame_size) - self.update_table_info( - case_info, frame_size, Mpps, throughput, "After Restart" + # set traffic option + traffic_opt = { + "delay": 5, + "duration": self.get_suite_cfg()["test_duration"], + } + _, pps = self.tester.pktgen.measure_throughput( + stream_ids=streams, options=traffic_opt + ) + Mpps = pps / 1000000.0 + line_rate = ( + Mpps * 100 / float(self.wirespeed(self.nic, frame_size, self.nb_ports)) ) + self.throughput[frame_size] = Mpps + results_row = [frame_size] + results_row.append(Mpps) + results_row.append(line_rate) + self.result_table_add(results_row) + self.result_table_print() + + def handle_expected(self): + """ + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg + """ + if load_global_setting(UPDATE_EXPECTED) == "yes": + for frame_size in self.frame_sizes: + self.expected_throughput[frame_size] = round( + self.throughput[frame_size], 3 + ) + + def handle_results(self): + """ + results handled process: + 1, save to self.test_results + 2, create test results table + """ + # save test results to self.test_result + header = self.table_header + header.append("Expected Throughput(Mpps)") + header.append("Status") + self.result_table_create(header) + for frame_size in self.frame_sizes: + wirespeed = self.wirespeed(self.nic, frame_size, self.nb_ports) + ret_data = {} + ret_data[header[0]] = str(frame_size) + _real = float(self.throughput[frame_size]) + _exp = float(self.expected_throughput[frame_size]) + ret_data[header[1]] = "{:.3f}".format(_real) + ret_data[header[2]] = "{:.3f}%".format(_real * 100 / wirespeed) + ret_data[header[3]] = "{:.3f}".format(_exp) + gap = _exp * -self.gap * 0.01 + if _real > _exp + gap: + ret_data[header[4]] = "PASS" + else: + ret_data[header[4]] = "FAIL" + self.test_result[frame_size] = deepcopy(ret_data) + + for frame_size in self.test_result.keys(): + table_row = list() + for i in range(len(header)): + table_row.append(self.test_result[frame_size][header[i]]) + self.result_table_add(table_row) + # present test results to screen + self.result_table_print() + self.verify( + "FAIL" not in self.test_result, + "Excessive gap between test results and expectations", + ) def close_all_testpmd(self): """ @@ -268,9 +291,25 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=True, mrg_rxbuf=True, packed=False) self.start_vm_testpmd(path="mergeable") - self.send_and_verify("virtio0.95 mergeable") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() - self.result_table_print() self.vm.stop() def test_perf_pvp_qemu_normal_mac(self): @@ -280,7 +319,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=True, mrg_rxbuf=False, packed=False) self.start_vm_testpmd(path="normal") - self.send_and_verify("virtio0.95 normal") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -292,7 +348,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=True, mrg_rxbuf=False, packed=False) self.start_vm_testpmd(path="vector_rx") - self.send_and_verify("virtio0.95 vector_rx") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -304,7 +377,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=True, packed=False) self.start_vm_testpmd(path="mergeable") - self.send_and_verify("virtio1.0 mergeable") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -316,7 +406,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=False, packed=False) self.start_vm_testpmd(path="normal") - self.send_and_verify("virtio1.0 normal") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -328,7 +435,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=False, packed=False) self.start_vm_testpmd(path="vector_rx") - self.send_and_verify("virtio1.0 vector_rx") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -340,7 +464,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=True, packed=True) self.start_vm_testpmd(path="mergeable") - self.send_and_verify("virtio1.1 mergeable") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -352,7 +493,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=False, packed=True) self.start_vm_testpmd(path="normal") - self.send_and_verify("virtio1.1 normal") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -364,7 +522,24 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_vhost_testpmd() self.start_one_vm(disable_modern=False, mrg_rxbuf=False, packed=True) self.start_vm_testpmd(path="vector_rx") - self.send_and_verify("virtio1.1 vector_rx") + + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + + self.port_restart() + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + self.close_all_testpmd() self.result_table_print() self.vm.stop() @@ -377,16 +552,25 @@ class TestPVPQemuMultiPathPortRestart(TestCase): self.start_one_vm(disable_modern=False, mrg_rxbuf=True, packed=False) self.start_vm_testpmd(path="mergeable") - case_info = "virtio1.0 mergeable" - Mpps, throughput = self.calculate_avg_throughput(64) - self.update_table_info(case_info, 64, Mpps, throughput, "Before Restart") + self.test_target = self.running_case + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] + self.perf_test() + self.handle_expected() + self.handle_results() + for cycle in range(10): self.logger.info("now port restart %d times" % (cycle + 1)) + self.test_target += "_restart_port" + self.expected_throughput = self.get_suite_cfg()["expected_throughput"][ + self.test_target + ] self.port_restart() - Mpps, throughput = self.calculate_avg_throughput(64) - self.update_table_info( - case_info, 64, Mpps, throughput, "After port restart" - ) + self.perf_test() + if cycle == 0: + self.handle_expected() + self.handle_results() self.close_all_testpmd() self.result_table_print() -- 2.25.1