From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 991CBAD92 for ; Fri, 13 Feb 2015 08:25:43 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 12 Feb 2015 23:25:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,569,1418112000"; d="scan'208";a="677385037" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by fmsmga002.fm.intel.com with ESMTP; 12 Feb 2015 23:25:40 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 13 Feb 2015 15:24:48 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Fri, 13 Feb 2015 15:24:46 +0800 From: "Qiu, Michael" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] framework: optimize dpdk package preparation process Thread-Index: AQHQRzm/Ybf57GgkAUyhhCmAHKZe+w== Date: Fri, 13 Feb 2015 07:24:46 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CE90DE@SHSMSX101.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> Accept-Language: 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: Fri, 13 Feb 2015 07:25:44 -0000 On 2/13/2015 11:04 AM, Yong Liu wrote:=0A= > If output/dpdk existed, only need pull latest code. If output/dpdk=0A= > not existed, will clone from dpdk.org. When failure happened, DTS=0A= > will exit.=0A= >=0A= > Signed-off-by: Marvinliu =0A= =0A= Acked-by: Michael Qiu =0A= > ---=0A= > framework/dts.py | 3 ---=0A= > framework/main.py | 25 ++++++++++++++-----------=0A= > 2 files changed, 14 insertions(+), 14 deletions(-)=0A= >=0A= > diff --git a/framework/dts.py b/framework/dts.py=0A= > index 871380b..3c73596 100644=0A= > --- a/framework/dts.py=0A= > +++ b/framework/dts.py=0A= > @@ -399,9 +399,6 @@ def run_all(config_file, pkgName, git, patch, skip_se= tup,=0A= > global stats=0A= > global log_handler=0A= > =0A= > - # change operation directory=0A= > - os.chdir("../")=0A= > -=0A= > # prepare the output folder=0A= > if not os.path.exists(output_dir):=0A= > os.mkdir(output_dir)=0A= > diff --git a/framework/main.py b/framework/main.py=0A= > index 3b2f484..0223f57 100755=0A= > --- a/framework/main.py=0A= > +++ b/framework/main.py=0A= > @@ -39,28 +39,30 @@ import sys=0A= > import argparse=0A= > import dts=0A= > =0A= > +# change operation directory=0A= > +os.chdir("../")=0A= > +=0A= > =0A= > def git_build_package(gitLabel, gitPkg, output):=0A= > """=0A= > - generate package from git=0A= > - run bash shell=0A= > + generate package from git, if dpdk existed will pull latest code=0A= > """=0A= > gitURL =3D r"http://dpdk.org/git/dpdk"=0A= > gitPrefix =3D r"dpdk/"=0A= > - print "git clone %s %s/%s" % (gitURL, output, gitPrefix)=0A= > - ret =3D os.system("git clone %s output/%s" % (gitURL, gitPrefix))=0A= > + if os.path.exists("%s/%s" % (output, gitPrefix)) is True:=0A= > + ret =3D os.system("cd %s/%s && git pull --force" % (output, gitP= refix))=0A= > + else:=0A= > + print "git clone %s %s/%s" % (gitURL, output, gitPrefix)=0A= > + ret =3D os.system("git clone %s output/%s" % (gitURL, gitPrefix)= )=0A= > if ret is not 0:=0A= > raise EnvironmentError=0A= > +=0A= > print "git archive --format=3Dtar.gz --prefix=3D%s %s -o %s" % (gitP= refix, gitLabel, gitPkg)=0A= > - ret =3D os.system("cd output/%s && git archive --format=3Dtar.gz --p= refix=3D%s %s -o %s" % (gitPrefix, gitPrefix, gitLabel, gitPkg))=0A= > + ret =3D os.system("cd %s/%s && git archive --format=3Dtar.gz --prefi= x=3D%s/ %s -o ../../%s"=0A= > + % (output, gitPrefix, gitPrefix, gitLabel, gitPkg))= =0A= > if ret is not 0:=0A= > raise EnvironmentError=0A= > =0A= > -#=0A= > -# Main program begins here=0A= > -#=0A= > -=0A= > -=0A= > # Read cmd-line args=0A= > parser =3D argparse.ArgumentParser(description=3D'DPDK test framework.')= =0A= > =0A= > @@ -118,7 +120,7 @@ parser.add_argument('-v', '--verbose',=0A= > args =3D parser.parse_args()=0A= > =0A= > =0A= > -# prepare DPDK source test package=0A= > +# prepare DPDK source test package, DTS will exited when failed.=0A= > if args.git is not None:=0A= > try:=0A= > git_build_package(args.git, args.snapshot, args.output)=0A= > @@ -126,6 +128,7 @@ if args.git is not None:=0A= > print "FAILED TO PREPARE DPDK PACKAGE!!!"=0A= > sys.exit()=0A= > =0A= > +# Main program begins here=0A= > dts.run_all(args.config_file, args.snapshot, args.git,=0A= > args.patch, args.skip_setup, args.read_cache,=0A= > args.project, args.suite_dir, args.test_cases,=0A= =0A=