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 885DAA04A2; Wed, 6 Nov 2019 08:40:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 54A7C1BFFB; Wed, 6 Nov 2019 08:40:39 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AB8F91BFF8 for ; Wed, 6 Nov 2019 08:40:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 23:40:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,274,1569308400"; d="scan'208";a="212710680" Received: from unknown (HELO dpdk-xiaoqimai-tester.sh.intel.com) ([10.240.179.35]) by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2019 23:40:35 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Wed, 6 Nov 2019 15:40:37 +0800 Message-Id: <1573026037-87704-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1]tests/TestSuite_telemetry: use existed session instead of creating a new session 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" optimize scripts, use existed session to send command Signed-off-by: Xiao Qimai --- tests/TestSuite_telemetry.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_telemetry.py b/tests/TestSuite_telemetry.py index c6e7e08..13a0729 100644 --- a/tests/TestSuite_telemetry.py +++ b/tests/TestSuite_telemetry.py @@ -451,13 +451,12 @@ class TestTelemetry(TestCase): def change_run_fileprefix(self, out): self.get_file_prefix(out) if self.file_prefix: - self.dut_session2 = self.dut.new_session() cmd1 = "sed -i 's/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/.*\/telemetry\")/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/{0}\/telemetry\")/g' {1}".format( self.file_prefix, os.path.join(self.target_dir, 'usertools/dpdk-telemetry-client.py')) - cmd = "sed -i 's/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/.*\/telemetry\")/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/{0}\/telemetry\")/g' {1}".format( + cmd2 = "sed -i 's/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/.*\/telemetry\")/self.socket.send_fd.connect(\"\/var\/run\/dpdk\/{0}\/telemetry\")/g' {1}".format( self.file_prefix, os.path.join(self.target_dir, 'dpdk_telemetry_client.py')) - self.dut_session2.send_expect(cmd1, "# ", 3) - self.dut_session2.send_expect(cmd, "# ", 3) + self.d_a_console(cmd1) + self.d_a_console(cmd2) self.change_flag = True def verify_basic_script(self): -- 1.8.3.1