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 38E6DA04DD; Thu, 2 Jan 2020 04:23:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25CC61BF9D; Thu, 2 Jan 2020 04:23:55 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 005E31BF83 for ; Thu, 2 Jan 2020 04:23:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2020 19:23:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,385,1571727600"; d="scan'208";a="216400086" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 01 Jan 2020 19:23:52 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Jan 2020 19:23:52 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Jan 2020 19:23:52 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.197]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.203]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 11:23:50 +0800 From: "Chen, Zhaoyan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Chen, Zhaoyan" Thread-Topic: [dts][PATCH V1 4/4] framework/project_dpdk: add judge of the value about snapshot_load_side Thread-Index: AQHVvIeAwCCL9p446UO9N4PwK/ivpKfWvwTg Date: Thu, 2 Jan 2020 03:23:49 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA41E76C66@SHSMSX104.ccr.corp.intel.com> References: <1577404987-1369-1-git-send-email-lihongx.ma@intel.com> <1577404987-1369-4-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1577404987-1369-4-git-send-email-lihongx.ma@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 4/4] framework/project_dpdk: add judge of the value about snapshot_load_side 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" Acked-by: Zhaoyan Chen Regards, Zhaoyan Chen > -----Original Message----- > From: Ma, LihongX > Sent: Friday, December 27, 2019 8:03 AM > To: dts@dpdk.org > Cc: Chen, Zhaoyan ; Ma, LihongX > Subject: [dts][PATCH V1 4/4] framework/project_dpdk: add judge of the val= ue about > snapshot_load_side >=20 > Signed-off-by: lihong > --- > framework/project_dpdk.py | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) >=20 > diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index > ddad526..3a0a449 100644 > --- a/framework/project_dpdk.py > +++ b/framework/project_dpdk.py > @@ -259,7 +259,23 @@ class DPDKdut(Dut): >=20 > def prepare_package(self): > if not self.skip_setup: > - assert (os.path.isfile(self.package) is True), "Invalid pack= age" > + session_info =3D None > + # if snapshot_load_side=3Ddut, will copy the dpdk tar from d= ut side > + # and will judge whether the path of tar is existed on dut > + if self.crb['snapshot_load_side'] =3D=3D 'dut': > + if not os.path.isabs(self.package): > + raise ValueError("As snapshot_load_side=3Ddut, will = copy dpdk.tar " > + "from dut, please specify a abs path= use params " > + "--snapshot when run dts") > + # if ':' in session, this is vm dut, use the dut session > + if ':' in self.session.name: > + session_info =3D self.host_dut.alt_session > + else: > + session_info =3D self.alt_session > + out =3D session_info.send_expect('ls -F %s' % self.packa= ge, '# ') > + assert (out =3D=3D self.package), "Invalid package" > + else: > + assert (os.path.isfile(self.package) is True), "Invalid p= ackage" >=20 > p_dir, _ =3D os.path.split(self.base_dir) > # ToDo: make this configurable @@ -271,7 +287,7 @@ class DPD= Kdut(Dut): > raise ValueError("Directory %s or %s does not exist," > "please check params -d" > % (p_dir, dst_dir)) > - self.session.copy_file_to(self.package, dst_dir) > + self.session.copy_file_to(self.package, dst_dir, > + crb_session=3Dsession_info) >=20 > # put patches to p_dir/patches/ > if (self.patches is not None): > -- > 2.7.4