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 CD435A0350; Wed, 1 Jul 2020 08:01:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C31791BF95; Wed, 1 Jul 2020 08:01:52 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5CA721BF95 for ; Wed, 1 Jul 2020 08:01:51 +0200 (CEST) IronPort-SDR: ArlsI4XjISYlN8P7exC3O5Xak9F7zshhs2BNYeW/wFesSg9Qi0bU/WO5cZ8k/yAn5wCJNtGKZd BGByu5MyPcYA== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="148037422" X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="148037422" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 23:01:51 -0700 IronPort-SDR: U0IWVG0Jz/NdlzZw0htkBAXwy5g6w38BAvJkfjVAeSWgFHjzqhNYb+Z1LqdlFP+rMuzemWfuJz toaTQCySIm7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="425468602" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by orsmga004.jf.intel.com with ESMTP; 30 Jun 2020 23:01:49 -0700 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Wed, 1 Jul 2020 14:01:39 +0800 Message-Id: <20200701060139.24422-3-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200701060139.24422-1-yufengx.mo@intel.com> References: <20200701060139.24422-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 2/2] power_branch_ratio: add suite config content and cpu 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" mapping #. add suite config content for traffic frame size and branch ratio threshold. #. add vcpu to pcpu mapping. Signed-off-by: yufengmx --- 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