From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EC8C0B56B for ; Sun, 15 Feb 2015 09:03:21 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 15 Feb 2015 00:03:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,580,1418112000"; d="scan'208";a="527760081" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by orsmga003.jf.intel.com with ESMTP; 14 Feb 2015 23:54:55 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 16:03:15 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.197]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.209]) with mapi id 14.03.0195.001; Sun, 15 Feb 2015 16:03:14 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 2/2] framework: make option -d to absolute path Thread-Index: AQHQSOq31GUagupGdEKK64CkvFSvGpzxVZdg Date: Sun, 15 Feb 2015 08:03:14 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10D7CEDF@SHSMSX103.ccr.corp.intel.com> References: <1423982583-6086-1-git-send-email-michael.qiu@intel.com> <1423982583-6086-2-git-send-email-michael.qiu@intel.com> In-Reply-To: <1423982583-6086-2-git-send-email-michael.qiu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 2/2] framework: make option -d to absolute path 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: , X-List-Received-Date: Sun, 15 Feb 2015 08:03:22 -0000 Michael, please see my comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Michael Qiu > Sent: Sunday, February 15, 2015 2:43 PM > To: dts@dpdk.org > Subject: [dts] [PATCH 2/2] framework: make option -d to absolute path >=20 > Option -d is used for dpdk directory name, which is not suitable. >=20 > Meanwhile, dts need make dpdk location in DUT more flexable. >=20 > Specify the absolute path with -d option to solve the issue. >=20 > Signed-off-by: Michael Qiu > --- > framework/main.py | 2 +- > framework/project_dpdk.py | 25 ++++++++++++++++++++----- > framework/ssh_connection.py | 2 +- > 3 files changed, 22 insertions(+), 7 deletions(-) >=20 > diff --git a/framework/main.py b/framework/main.py > index 0223f57..fe456ea 100755 > --- a/framework/main.py > +++ b/framework/main.py > @@ -110,7 +110,7 @@ parser.add_argument('-t', '--test-cases', > help=3D'executes only the followings test cases') >=20 > parser.add_argument('-d', '--dir', > - default=3D'dpdk', > + default=3D'dep/dpdk', > help=3D'Output directory where dpdk package is > extracted') >=20 This parameter mean the directory of exacted dpdk package. Supposed to use = "~/dpdk" as default value. Suggest change dpdk update function, dpdk git folder changed to dep/dpdk . > parser.add_argument('-v', '--verbose', > diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py > index 8448a61..1044cbe 100644 > --- a/framework/project_dpdk.py > +++ b/framework/project_dpdk.py > @@ -198,10 +198,17 @@ class DPDKdut(Dut): > if not self.skip_setup: > assert (os.path.isfile(pkgName) is True), "Invalid package" >=20 > - self.session.copy_file_to(pkgName) > + p_dir, _ =3D os.path.split(self.base_dir) > + # ToDo: make this configurable > + patch_dir =3D p_dir + '/patches/' > + self.send_expect("mkdir -p %s && mkdir -p %s && cd %s" % > + (p_dir, patch_dir, p_dir), "#") Suppose DTS should not create folder in DUT, we can transfer files to tmp f= older.=20 > + self.session.copy_file_to(pkgName, p_dir) > + > + # put patches to p_dir/patches/ > if (patch is not None): > for p in patch: > - self.session.copy_file_to('../' + p) > + self.session.copy_file_to('dep/' + p, patch_dir) >=20 > self.kill_all() >=20 > @@ -216,13 +223,21 @@ class DPDKdut(Dut): > self.send_expect("rm -rf %s" % self.base_dir, "#") >=20 > # unpack dpdk > - out =3D self.send_expect("tar zxf " + pkgName.split('/')[-1]= , > "# ", 20) > + out =3D self.send_expect("tar zxf %s -C %s" % > + (pkgName.split('/')[-1], p_dir), "# "= , > 20) Can we use send_expect(verify=3DTrue) here to make sure DPDK package is fin= e. This step is very important for later validation. > assert "Error" not in out >=20 > + # check dpdk dir name is expect > + out =3D self.send_expect("ls %s" % self.base_dir, > + "# ", 20, verify =3D True) > + if out =3D=3D -1: > + raise ValueError("dpdk dir %s mismatch, please check > params -d" > + % self.base_dir) > + > if (patch is not None): > for p in patch: > - out =3D self.send_expect("patch -d %s -p1 < ../%s" % > - (self.base_dir, p), "# ") > + out =3D self.send_expect("patch -d %s -p1 < %s" % > + (self.base_dir, patch_dir + p= ), > "# ") > assert "****" not in out >=20 > self.dut_prerequisites() > diff --git a/framework/ssh_connection.py b/framework/ssh_connection.py > index f3debc1..d1075b5 100644 > --- a/framework/ssh_connection.py > +++ b/framework/ssh_connection.py > @@ -51,7 +51,7 @@ class SSHConnection(object): >=20 > def send_expect(self, cmds, expected, timeout=3D15, verify=3DFalse): > self.logger.info(cmds) > - out =3D self.session.send_expect(cmds, expected, timeout, > verify=3DFalse) > + out =3D self.session.send_expect(cmds, expected, timeout, verify= ) > self.logger.debug(out) > return out >=20 > -- > 1.9.3