From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CFD97B51F for ; Sun, 15 Feb 2015 04:02:33 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 14 Feb 2015 18:55:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,578,1418112000"; d="scan'208";a="685891696" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga002.jf.intel.com with ESMTP; 14 Feb 2015 19:02:31 -0800 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 11:02:29 +0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 11:02:29 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.197]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.192]) with mapi id 14.03.0195.001; Sun, 15 Feb 2015 11:02:28 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] framework: optimize dpdk package preparation process Thread-Index: AQHQRzm5xvmg+emr8kadYvdAf83ak5zxCStA Date: Sun, 15 Feb 2015 03:02:26 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10D7CAA2@SHSMSX103.ccr.corp.intel.com> References: <1423473775-2841-1-git-send-email-yong.liu@intel.com> <1423796623-14889-1-git-send-email-yong.liu@intel.com> <533710CFB86FA344BFBF2D6802E60286CE90DE@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CE90DE@SHSMSX101.ccr.corp.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] framework: optimize dpdk package preparation process 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 03:02:34 -0000 Applied. Thx. > -----Original Message----- > From: Qiu, Michael > Sent: Friday, February 13, 2015 3:25 PM > To: Liu, Yong; dts@dpdk.org > Subject: Re: [dts] [PATCH] framework: optimize dpdk package preparation > process >=20 > On 2/13/2015 11:04 AM, Yong Liu wrote: > > If output/dpdk existed, only need pull latest code. If output/dpdk > > not existed, will clone from dpdk.org. When failure happened, DTS > > will exit. > > > > Signed-off-by: Marvinliu >=20 > Acked-by: Michael Qiu > > --- > > framework/dts.py | 3 --- > > framework/main.py | 25 ++++++++++++++----------- > > 2 files changed, 14 insertions(+), 14 deletions(-) > > > > diff --git a/framework/dts.py b/framework/dts.py > > index 871380b..3c73596 100644 > > --- a/framework/dts.py > > +++ b/framework/dts.py > > @@ -399,9 +399,6 @@ def run_all(config_file, pkgName, git, patch, > skip_setup, > > global stats > > global log_handler > > > > - # change operation directory > > - os.chdir("../") > > - > > # prepare the output folder > > if not os.path.exists(output_dir): > > os.mkdir(output_dir) > > diff --git a/framework/main.py b/framework/main.py > > index 3b2f484..0223f57 100755 > > --- a/framework/main.py > > +++ b/framework/main.py > > @@ -39,28 +39,30 @@ import sys > > import argparse > > import dts > > > > +# change operation directory > > +os.chdir("../") > > + > > > > def git_build_package(gitLabel, gitPkg, output): > > """ > > - generate package from git > > - run bash shell > > + generate package from git, if dpdk existed will pull latest code > > """ > > gitURL =3D r"http://dpdk.org/git/dpdk" > > gitPrefix =3D r"dpdk/" > > - print "git clone %s %s/%s" % (gitURL, output, gitPrefix) > > - ret =3D os.system("git clone %s output/%s" % (gitURL, gitPrefix)) > > + if os.path.exists("%s/%s" % (output, gitPrefix)) is True: > > + ret =3D os.system("cd %s/%s && git pull --force" % (output, > gitPrefix)) > > + else: > > + print "git clone %s %s/%s" % (gitURL, output, gitPrefix) > > + ret =3D os.system("git clone %s output/%s" % (gitURL, gitPrefi= x)) > > if ret is not 0: > > raise EnvironmentError > > + > > print "git archive --format=3Dtar.gz --prefix=3D%s %s -o %s" % > (gitPrefix, gitLabel, gitPkg) > > - ret =3D os.system("cd output/%s && git archive --format=3Dtar.gz -= - > prefix=3D%s %s -o %s" % (gitPrefix, gitPrefix, gitLabel, gitPkg)) > > + ret =3D os.system("cd %s/%s && git archive --format=3Dtar.gz -- > prefix=3D%s/ %s -o ../../%s" > > + % (output, gitPrefix, gitPrefix, gitLabel, gitPkg)= ) > > if ret is not 0: > > raise EnvironmentError > > > > -# > > -# Main program begins here > > -# > > - > > - > > # Read cmd-line args > > parser =3D argparse.ArgumentParser(description=3D'DPDK test framework.= ') > > > > @@ -118,7 +120,7 @@ parser.add_argument('-v', '--verbose', > > args =3D parser.parse_args() > > > > > > -# prepare DPDK source test package > > +# prepare DPDK source test package, DTS will exited when failed. > > if args.git is not None: > > try: > > git_build_package(args.git, args.snapshot, args.output) > > @@ -126,6 +128,7 @@ if args.git is not None: > > print "FAILED TO PREPARE DPDK PACKAGE!!!" > > sys.exit() > > > > +# Main program begins here > > dts.run_all(args.config_file, args.snapshot, args.git, > > args.patch, args.skip_setup, args.read_cache, > > args.project, args.suite_dir, args.test_cases,