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 B60FAA04F6; Tue, 7 Jan 2020 09:49:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 877681D617; Tue, 7 Jan 2020 09:49:16 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 6EFF21C20F for ; Tue, 7 Jan 2020 09:49:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 00:49:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,405,1571727600"; d="scan'208";a="253663027" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.179.33]) by fmsmga002.fm.intel.com with ESMTP; 07 Jan 2020 00:49:13 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Tue, 7 Jan 2020 16:46:53 +0800 Message-Id: <1578386813-102975-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo 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" testpmd launched with file-prefix, so need add this parameter when starting dpdk-procinfo Signed-off-by: Xiao Qimai --- tests/TestSuite_ethtool_stats.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_ethtool_stats.py b/tests/TestSuite_ethtool_stats.py index e8ea941..e5d8164 100644 --- a/tests/TestSuite_ethtool_stats.py +++ b/tests/TestSuite_ethtool_stats.py @@ -97,8 +97,17 @@ class TestEthtoolStats(TestCase): self.testpmd = PmdOutput(self.dut) self.is_pmd_on = False + def get_prefix(self, out): + p = re.compile("socket\s+/var/run/dpdk/(.+?)/") + m = p.search(out) + if m: + self.prefix_option = "--file-prefix=%s" % m.group(1) + else: + self.prefix_option = None + def start_testpmd(self): - self.testpmd.start_testpmd('1S/2C/1T', param='--port-topology=loop') + out = self.testpmd.start_testpmd('1S/2C/1T', param='--port-topology=loop') + self.get_prefix(out) self.is_pmd_on = True time.sleep(2) @@ -157,8 +166,12 @@ class TestEthtoolStats(TestCase): ports_count = len(self.dut_ports) ports_mask = reduce(lambda x, y: x | y, map(lambda x: 0x1 << x, range(ports_count))) - self.query_tool = os.path.join( - self.target_dir, self.target, 'app', 'dpdk-procinfo') + if self.prefix_option: + self.query_tool = os.path.join( + self.target_dir, self.target, 'app', 'dpdk-procinfo %s' % self.prefix_option) + else: + self.query_tool = os.path.join( + self.target_dir, self.target, 'app', 'dpdk-procinfo') self.dpdk_proc_info = "%s -v -- -p %s" % (self.query_tool, ports_mask) def parse_proc_info_xstat_output(self, msg): @@ -384,6 +397,7 @@ class TestEthtoolStats(TestCase): except_content = None try: self.start_testpmd() + self.init_proc_info() self.set_testpmd() self.check_xstat_command_list() except Exception as e: @@ -401,6 +415,7 @@ class TestEthtoolStats(TestCase): except_content = None try: self.start_testpmd() + self.init_proc_info() self.set_testpmd() self.traffic() self.clear_pmd_ports_stat() @@ -420,6 +435,7 @@ class TestEthtoolStats(TestCase): except_content = None try: self.start_testpmd() + self.init_proc_info() self.set_testpmd() self.check_xstat_statistic_integrity() except Exception as e: @@ -462,7 +478,6 @@ class TestEthtoolStats(TestCase): self.frame_sizes = [64, 72, 128, 256, 512, 1024] # init binary self.init_testpmd() - self.init_proc_info() # # Test cases. # -- 2.17.1