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 28B6FA04DB; Thu, 10 Dec 2020 12:22:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0325DBE75; Thu, 10 Dec 2020 12:22:46 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id F2E2DBC8A for ; Thu, 10 Dec 2020 12:22:44 +0100 (CET) IronPort-SDR: 8E+Jv3PwDBaDYpNQSXfLJmAQ7lDITwUooN7jdDuHTysphwVHG/X2suAWBOXtO+Jggt6wisOpqE e7eG9nFYxTgA== X-IronPort-AV: E=McAfee;i="6000,8403,9830"; a="258953855" X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="258953855" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 03:22:43 -0800 IronPort-SDR: BqG0TwAc81xe41tE6pOoY8b7YMh53NnEPcrfK8W6isTeYcOjPRT9gjstwq2aRrgfcvcgbcf8kl SfREv7iTpCoQ== X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="542804815" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 03:22:41 -0800 From: Zhou Jun To: dts@dpdk.org Cc: Zhou Jun Date: Thu, 10 Dec 2020 19:25:32 +0800 Message-Id: <20201210112532.21961-1-junx.w.zhou@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/TestSuite_distributor:Modify the hard coded appparameter 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" Modify the hard coded appparameter to call the platform interface Signed-off-by: Zhou Jun --- tests/TestSuite_distributor.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/TestSuite_distributor.py b/tests/TestSuite_distributor.py index e5a8454e..2bfe6ee6 100644 --- a/tests/TestSuite_distributor.py +++ b/tests/TestSuite_distributor.py @@ -76,7 +76,8 @@ class TestDistributor(TestCase): """ Run distributor unit test """ - self.dut.send_expect("./%s -n 1 -c f" % self.app_test_path, "RTE>>", 60) + eal_para = self.dut.create_eal_parameters(cores=[0, 1, 2, 3]) + self.dut.send_expect("./%s %s" % (self.app_test_path, eal_para), "RTE>>", 60) out = self.dut.send_expect("distributor_autotest", "RTE>>", 30) self.dut.send_expect("quit", "# ") self.verify("Test OK" in out, "Test failed") @@ -85,7 +86,8 @@ class TestDistributor(TestCase): """ Run distributor unit perf test """ - self.dut.send_expect("./%s -n 1 -c f" % self.app_test_path, "RTE>>", 60) + eal_para = self.dut.create_eal_parameters(cores=[0, 1, 2, 3]) + self.dut.send_expect("./%s %s" % (self.app_test_path, eal_para), "RTE>>", 60) out = self.dut.send_expect("distributor_perf_autotest", "RTE>>", 120) cycles_single = self.strip_cycles(out, "single") cycles_burst = self.strip_cycles(out, "burst") @@ -112,7 +114,7 @@ class TestDistributor(TestCase): "Throughput Rate Pkts out line rate"] # output port is calculated from overall ports number - cmd_fmt = "%s -c %s -n %d -w %s -- -p 0x1" + cmd_fmt = "%s %s -- -p 0x1" socket = self.dut.get_numa_id(self.dut_ports[0]) pcap = os.sep.join([self.output_path, "distributor.pcap"]) @@ -133,10 +135,8 @@ class TestDistributor(TestCase): if len(cores) < (worker_num + 4): cores = self._get_thread_lcore(worker_num + 4) - cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores), - self.dut.get_memory_channels(), - self.dut.get_port_pci(self.dut_ports[0])) - + eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0]) + cmd = cmd_fmt % (self.app_distributor_path, eal_para) self.dut.send_expect(cmd, "doing packet RX", timeout=30) # clear streams before add new streams @@ -163,8 +163,8 @@ class TestDistributor(TestCase): Check distributor app work fine with maximum workers """ self.verify(len(self.dut_ports) >= 1, "Not enough ports") - cmd_fmt = "%s -c %s -n %d -w %s -- -p 0x1" + cmd_fmt = "%s %s -- -p 0x1" out = self.dut.send_expect("sed -n '/#define RTE_DISTRIB_MAX_WORKERS/p' lib/librte_distributor/distributor_private.h", "# ") reg_match = r"#define RTE_DISTRIB_MAX_WORKERS (.*)" m = re.match(reg_match, out) @@ -172,11 +172,8 @@ class TestDistributor(TestCase): max_workers = int(m.group(1)) cores = self._get_thread_lcore(max_workers - 1 + 4) - - cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores), - self.dut.get_memory_channels(), - self.dut.get_port_pci(self.dut_ports[0])) - + eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0]) + cmd = cmd_fmt % (self.app_distributor_path, eal_para) self.dut.send_expect(cmd, "doing packet RX", timeout=30) tx_port = self.tester.get_local_port(self.dut_ports[0]) @@ -190,15 +187,13 @@ class TestDistributor(TestCase): Check distributor app work fine with multiple ports """ self.verify(len(self.dut_ports) >= 2, "Not enough ports") - cmd_fmt = "%s -c %s -n %d -w %s -w %s -- -p 0x3" + + cmd_fmt = "%s %s -- -p 0x3" socket = self.dut.get_numa_id(self.dut_ports[0]) cores = self.dut.get_core_list("1S/%dC/1T" % (2 + 4), socket) - cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores), - self.dut.get_memory_channels(), - self.dut.get_port_pci(self.dut_ports[0]), - self.dut.get_port_pci(self.dut_ports[1])) - + eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0,1]) + cmd = cmd_fmt % (self.app_distributor_path, eal_para) self.dut.send_expect(cmd, "doing packet RX", timeout=30) tx_port = self.tester.get_local_port(self.dut_ports[0]) -- 2.17.1