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 25D21A053A; Tue, 4 Aug 2020 10:42:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD0D41C025; Tue, 4 Aug 2020 10:42:22 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id CC8D1A3 for ; Tue, 4 Aug 2020 10:42:21 +0200 (CEST) IronPort-SDR: xqstMIAuAeYzTOnowlWCLoQV+JW28plpUwxt+HnP3uFh8HY0TkqoJewNcPXQjfHEETgoe9fUZS +f3h6I8HBLRg== X-IronPort-AV: E=McAfee;i="6000,8403,9702"; a="213812713" X-IronPort-AV: E=Sophos;i="5.75,433,1589266800"; d="scan'208";a="213812713" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 01:42:20 -0700 IronPort-SDR: SQg3T+pkx1ABy85JoeM/l80+zp4Fj/IgB4z3I5dil5py0VSJoqklHshzp4RPiqmflzPdEbFa9c 1Xj5qKp+vsiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,433,1589266800"; d="scan'208";a="396509028" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga001.fm.intel.com with ESMTP; 04 Aug 2020 01:42:19 -0700 From: lingwei To: dts@dpdk.org Cc: lingwei Date: Tue, 4 Aug 2020 16:28:04 +0000 Message-Id: <20200804162804.90125-1-weix.ling@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V4] tests/TestSuite_multiprocess.py Compatible run when tester and dut in same server and fix testcase step issue 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" compatible run when tester and dut in same server,and fix testcase setp Signed-off-by: lingwei --- tests/TestSuite_multiprocess.py | 36 +++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py index 5a99ee3..d38123a 100644 --- a/tests/TestSuite_multiprocess.py +++ b/tests/TestSuite_multiprocess.py @@ -259,10 +259,17 @@ class TestMultiprocess(TestCase): for n in range(len(validExecutions)): execution = validExecutions[n] - coreMask = utils.create_mask(self.dut.get_core_list(execution['cores'], socket=self.socket)) - self.session_secondary.send_expect( - self.app_symmetric_mp + " -c %s --proc-type=auto -- -p %s --num-procs=%d --proc-id=%d" % ( - coreMask, portMask, execution['nprocs'], n), "Finished Process Init") + # get coreList form execution['cores'] + coreList = self.dut.get_core_list(execution['cores'], socket=self.socket) + # to run a set of symmetric_mp instances, like test plan + dutSessionList = [] + for index in range(len(coreList)): + dut_new_session = self.dut.new_session() + dutSessionList.append(dut_new_session) + # add -w option when tester and dut in same server + dut_new_session.send_expect( + self.app_symmetric_mp + " -c %s --proc-type=auto %s -- -p %s --num-procs=%d --proc-id=%d" % ( + utils.create_mask([coreList[index]]), self.eal_param, portMask, execution['nprocs'], index), "Finished Process Init") # clear streams before add new streams self.tester.pktgen.clear_streams() @@ -274,6 +281,9 @@ class TestMultiprocess(TestCase): # close all symmetric_mp process self.dut.send_expect("killall symmetric_mp", "# ") + # close all dut sessions + for dut_session in dutSessionList: + self.dut.close_session(dut_session) # get rate and mpps data for n in range(len(executions)): @@ -311,19 +321,21 @@ class TestMultiprocess(TestCase): for execution in validExecutions: coreList = self.dut.get_core_list(execution['cores'], socket=self.socket) - - coreMask = utils.create_mask(self.dut.get_core_list('1S/1C/1T')) + # get core with socket parameter to specified which core dut used when tester and dut in same server + coreMask = utils.create_mask(self.dut.get_core_list('1S/1C/1T', socket=self.socket)) portMask = utils.create_mask(self.dut_ports) - self.dut.send_expect(self.app_mp_server + " -n %d -c %s -- -p %s -n %d" % ( - self.dut.get_memory_channels(), "0xA0", portMask, execution['nprocs']), "Finished Process Init", 20) + # specified mp_server core and add -w option when tester and dut in same server + self.dut.send_expect(self.app_mp_server + " -n %d -c %s %s -- -p %s -n %d" % ( + self.dut.get_memory_channels(), coreMask, self.eal_param, portMask, execution['nprocs']), "Finished Process Init", 20) self.dut.send_expect("^Z", "\r\n") self.dut.send_expect("bg", "# ") for n in range(execution['nprocs']): time.sleep(5) - coreMask = utils.create_mask([coreList[n]]) - self.dut.send_expect(self.app_mp_client + " -n %d -c %s --proc-type=secondary -- -n %d" % ( - self.dut.get_memory_channels(), coreMask, n), "Finished Process Init") + # use next core as mp_client core, different from mp_server + coreMask = utils.create_mask([str(int(coreList[n]) + 1)]) + self.dut.send_expect(self.app_mp_client + " -n %d -c %s --proc-type=secondary %s -- -n %d" % ( + self.dut.get_memory_channels(), coreMask, self.eal_param, n), "Finished Process Init") self.dut.send_expect("^Z", "\r\n") self.dut.send_expect("bg", "# ") @@ -376,6 +388,4 @@ class TestMultiprocess(TestCase): Run after each test suite. """ self.dut.kill_all() - self.dut.close_session(self.session_secondary) - pass -- 2.17.1