test suite reviews and discussions
 help / color / 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 2/2] power_branch_ratio: add suite config content and cpu
Date: Wed,  1 Jul 2020 14:01:39 +0800
Message-ID: <20200701060139.24422-3-yufengx.mo@intel.com> (raw)
In-Reply-To: <20200701060139.24422-1-yufengx.mo@intel.com>

 mapping

#. add suite config content for traffic frame size and branch ratio threshold.
#. add vcpu to pcpu mapping.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/TestSuite_power_branch_ratio.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_power_branch_ratio.py b/tests/TestSuite_power_branch_ratio.py
index e055b03..8bd82d4 100644
--- a/tests/TestSuite_power_branch_ratio.py
+++ b/tests/TestSuite_power_branch_ratio.py
@@ -152,7 +152,7 @@ class TestPowerBranchRatio(TestCase):
                 'type': pkt_name.upper(),
                 'pkt_layers': {
                     'ether': {'dst': dmac},
-                    'raw': {'payload': ['58'] * self.get_pkt_len(pkt_name)}}},
+                    'raw': {'payload': ['58'] * self.get_pkt_len(pkt_name, frame_size=self.frame_size)}}},
         }
         # create packet for send
         if stm_name not in list(pkt_configs.keys()):
@@ -229,7 +229,7 @@ class TestPowerBranchRatio(TestCase):
         self.d_a_con(cmd)
 
     def init_vms_params(self):
-        self.vcpu_map = self.vm = self.vm_dut = self.guest_session = None
+        self.vcpu_map = self.vcpu_lst = self.vm = self.vm_dut = self.guest_session = None
         self.vm_log_dir = '/tmp/powermonitor'
         self.create_powermonitor_folder()
 
@@ -267,7 +267,8 @@ class TestPowerBranchRatio(TestCase):
         self.verify(self.vm_dut, "create vm_dut fail !")
         self.add_console(self.vm_dut.session)
         # get virtual machine cpu cores
-        self.vcpu_map = self.vm.get_vm_cpu()
+        self.vcpu_map = [int(core) for core in self.vm.get_vm_cpu()]
+        self.vcpu_lst = [int(item['core']) for item  in self.vm_dut.cores]
 
     def close_vm(self):
         '''
@@ -383,7 +384,7 @@ class TestPowerBranchRatio(TestCase):
                 'file_prefix': 'vmpower1',
                 'vm_name': self.vm_name,
                 'vpus': ','.join(
-                    [str(int(index) - 1) for index in self.vcpu_map]),
+                    [str(index) for index in self.vcpu_lst]),
             })
         guest_cmd = ' '.join([self.guest_cli, option])
         self.vm_g_con([guest_cmd, prompt, 120])
@@ -573,7 +574,7 @@ class TestPowerBranchRatio(TestCase):
             # run traffic
             option = {'stm_type': 'UDP_1', }
             self.run_traffic(option)
-            time.sleep(2)
+            time.sleep(10)
             # check test result
             self.check_core_freq_in_traffic(self.check_core)
             self.check_vm_power_mgr_output()
@@ -625,7 +626,10 @@ class TestPowerBranchRatio(TestCase):
         self.init_vm_power_mgr()
         self.init_vm_testpmd()
         self.init_guest_mgr()
-        self.check_core = 2
+        test_content = self.get_suite_cfg()
+        self.frame_size = test_content.get('frame_size') or 1024
+        self.check_ratio = test_content.get('check_ratio') or 0.1
+        self.check_core = self.vcpu_map[1]
         msg = "select dut core {} as check core".format(self.check_core)
         self.logger.info(msg)
     #
@@ -675,5 +679,5 @@ class TestPowerBranchRatio(TestCase):
         """
         Set Branch-Ratio Rate by User
         """
-        self.branch_ratio = 0.1
+        self.branch_ratio = self.check_ratio
         self.verify_branch_ratio()
-- 
2.21.0


  parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  6:01 [dts] [PATCH V1 0/2] power_branch_ratio: add suite config content and cpu mapping yufengmx
2020-07-01  6:01 ` [dts] [PATCH V1 1/2] power_branch_ratio: add suite config content yufengmx
2020-07-01  6:01 ` yufengmx [this message]
2020-07-01  6:18 ` [dts] [PATCH V1 0/2] power_branch_ratio: add suite config content and cpu mapping Tu, Lijuan

Reply instructions:

You may reply publically 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=20200701060139.24422-3-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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox