From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6251FA0563; Mon, 23 Mar 2020 03:14:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FCAB1BF71; Mon, 23 Mar 2020 03:14:15 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id F2213F94 for ; Mon, 23 Mar 2020 03:14:13 +0100 (CET) IronPort-SDR: DnEJdts7cyhOdVE73DexmjtjpniJlBBaAKi5v5pYBYLJ6cW+RIhh71dye7ikKkTCs00YVYotKo OIUL6btSlGXw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 19:14:13 -0700 IronPort-SDR: 1tHOZcxvY5yKim86gsSAwuYtLnjflb7nIDVynmj2y/MCJuFPlWWjOusMUk1OeYbHTxqDN7eKDj 32FtuI13SJWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,294,1580803200"; d="scan'208";a="249469945" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by orsmga006.jf.intel.com with ESMTP; 22 Mar 2020 19:14:12 -0700 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Mon, 23 Mar 2020 10:10:31 +0800 Message-Id: <20200323021031.11393-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200323021031.11393-1-yufengx.mo@intel.com> References: <20200323021031.11393-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 1/1] tests/power_bidirection_channel: python3 support and script X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" optimize #. python3 support. #. display dpdk version. #. use ^C to take the place of killall. Signed-off-by: yufengmx --- tests/TestSuite_power_bidirection_channel.py | 21 ++++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_power_bidirection_channel.py b/tests/TestSuite_power_bidirection_channel.py index ed82fda..8159e11 100644 --- a/tests/TestSuite_power_bidirection_channel.py +++ b/tests/TestSuite_power_bidirection_channel.py @@ -31,7 +31,7 @@ """ DPDK Test suite. -virtual power manager test suite. +power bidirection channel test suite. """ import os import time @@ -44,8 +44,6 @@ from test_case import TestCase class TestPowerBidirectionChannel(TestCase): - # temporary file directory - output_path = '/tmp' @property def target_dir(self): @@ -95,7 +93,7 @@ class TestPowerBidirectionChannel(TestCase): console, msg_pipe = self.get_console(name) if len(cmds) == 0: return - if isinstance(cmds, (str, unicode)): + if isinstance(cmds, str): cmds = [cmds, '# ', 5] if not isinstance(cmds[0], list): cmds = [cmds] @@ -103,10 +101,8 @@ class TestPowerBidirectionChannel(TestCase): for item in cmds: expected_items = item[1] if expected_items and isinstance(expected_items, (list, tuple)): - check_output = True expected_str = expected_items[0] or '# ' else: - check_output = False expected_str = expected_items or '# ' try: @@ -195,14 +191,14 @@ class TestPowerBidirectionChannel(TestCase): # get high priority core and normal core base_freqs_info = {} - for core_index, value in cpu_info.iteritems(): + for core_index, value in cpu_info.items(): base_frequency = value.get('base_frequency') base_freqs_info.setdefault(base_frequency, []).append(core_index) - base_freqs = base_freqs_info.keys() + base_freqs = list(base_freqs_info.keys()) # cpu should have high priority core and normal core # high priority core frequency is higher than normal core frequency if len(base_freqs) <= 1 or \ - not all([len(value) for value in base_freqs_info.values()]): + not all([len(value) for value in list(base_freqs_info.values())]): msg = 'current cpu has no high priority core' raise Exception(msg) @@ -273,15 +269,14 @@ class TestPowerBidirectionChannel(TestCase): self.vm_power_mgr = self.prepare_binary('vm_power_manager') def start_vm_power_mgr(self): - eal_option = ( - ' ' + option = ( + ' -v ' '-c {core_mask} ' '-n {mem_channel} ' '--no-pci ').format(**{ 'core_mask': self.get_cores_mask("1S/3C/1T"), 'mem_channel': self.dut.get_memory_channels(), }) prompt = 'vmpower>' - option = eal_option cmd = [' '.join([self.vm_power_mgr, option]), prompt, 30] self.d_con(cmd) self.is_mgr_on = True @@ -321,7 +316,7 @@ class TestPowerBidirectionChannel(TestCase): def start_guest_mgr(self): prompt = r"vmpower\(guest\)>" option = ( - ' ' + ' -v ' '-c {core_mask} ' '-n {memory_channel} ' '-m {memory_size} ' -- 2.21.0