test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, lei.a.yao@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 1/1] tests/power_bidirection_channel: python3 support and script
Date: Mon, 23 Mar 2020 10:10:31 +0800	[thread overview]
Message-ID: <20200323021031.11393-2-yufengx.mo@intel.com> (raw)
In-Reply-To: <20200323021031.11393-1-yufengx.mo@intel.com>

 optimize

#. python3 support.
#. display dpdk version.
#. use ^C to take the place of killall.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 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


  reply	other threads:[~2020-03-23  2:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23  2:10 [dts] [PATCH V1 0/1] power_bidirection_channel: python3 support and script optimize yufengmx
2020-03-23  2:10 ` yufengmx [this message]
2020-03-24  6:51   ` [dts] [PATCH V1 1/1] tests/power_bidirection_channel: python3 support and script Tu, Lijuan
2020-03-23  2:19 ` [dts] [PATCH V1 0/1] power_bidirection_channel: python3 support and script optimize Mo, YufengX
2020-03-25  1:46   ` Yao, Lei A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200323021031.11393-2-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lei.a.yao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).