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 0C25BA04F0; Fri, 27 Dec 2019 08:30:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 022691BFF7; Fri, 27 Dec 2019 08:30:11 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 882F41BFF2 for ; Fri, 27 Dec 2019 08:30:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Dec 2019 23:30:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,362,1571727600"; d="scan'208";a="243166506" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by fmsmga004.fm.intel.com with ESMTP; 26 Dec 2019 23:30:08 -0800 From: lihong To: dts@dpdk.org Cc: zhaoyan.chen@intel.com, lihong Date: Fri, 27 Dec 2019 08:03:07 +0800 Message-Id: <1577404987-1369-4-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1577404987-1369-1-git-send-email-lihongx.ma@intel.com> References: <1577404987-1369-1-git-send-email-lihongx.ma@intel.com> Subject: [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" Signed-off-by: lihong --- framework/project_dpdk.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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): def prepare_package(self): if not self.skip_setup: - assert (os.path.isfile(self.package) is True), "Invalid package" + session_info = None + # if snapshot_load_side=dut, will copy the dpdk tar from dut side + # and will judge whether the path of tar is existed on dut + if self.crb['snapshot_load_side'] == 'dut': + if not os.path.isabs(self.package): + raise ValueError("As snapshot_load_side=dut, 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 = self.host_dut.alt_session + else: + session_info = self.alt_session + out = session_info.send_expect('ls -F %s' % self.package, '# ') + assert (out == self.package), "Invalid package" + else: + assert (os.path.isfile(self.package) is True), "Invalid package" p_dir, _ = os.path.split(self.base_dir) # ToDo: make this configurable @@ -271,7 +287,7 @@ class DPDKdut(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=session_info) # put patches to p_dir/patches/ if (self.patches is not None): -- 2.7.4