From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 85B36B517 for ; Sun, 15 Feb 2015 03:54:30 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 14 Feb 2015 18:54:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,578,1418112000"; d="scan'208";a="685890544" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga002.jf.intel.com with ESMTP; 14 Feb 2015 18:54:28 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 10:54:26 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.197]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.161]) with mapi id 14.03.0195.001; Sun, 15 Feb 2015 10:54:25 +0800 From: "Liu, Yong" To: "dts@dpdk.org" Thread-Topic: [PATCH] framework: change default running directory to parent directory Thread-Index: AQHQREkPtuDveeZsC0e+92uIL9B2rpznhUqAgAmHeYA= Date: Sun, 15 Feb 2015 02:54:24 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10D7CA81@SHSMSX103.ccr.corp.intel.com> References: <1423473356-2366-1-git-send-email-yong.liu@intel.com> <1423473775-2841-1-git-send-email-yong.liu@intel.com> In-Reply-To: <1423473775-2841-1-git-send-email-yong.liu@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: change default running directory to parent directory 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 02:54:31 -0000 Applied. Thx. > -----Original Message----- > From: Liu, Yong > Sent: Monday, February 09, 2015 5:23 PM > To: dts@dpdk.org > Cc: Liu, Yong > Subject: [PATCH] framework: change default running directory to parent > directory >=20 > Previous default running directory of DTS is under framework. This will > cause > confusion sometimes. >=20 > Signed-off-by: Marvinliu > --- > framework/config.py | 4 ++-- > framework/dts.py | 13 ++++++++++--- > framework/main.py | 14 +++++++------- > framework/rst.py | 4 ++-- > framework/settings.py | 8 ++++++++ > 5 files changed, 29 insertions(+), 14 deletions(-) >=20 > diff --git a/framework/config.py b/framework/config.py > index af014a8..d2548e8 100755 > --- a/framework/config.py > +++ b/framework/config.py > @@ -37,8 +37,8 @@ import re > import ConfigParser # config parse module > import argparse # prase arguments module >=20 > -portconf =3D "../conf/ports.cfg" > -crbconf =3D "../conf/crbs.cfg" > +portconf =3D "conf/ports.cfg" > +crbconf =3D "conf/crbs.cfg" >=20 >=20 > class UserConf(): > diff --git a/framework/dts.py b/framework/dts.py > index 9ba23fe..bddbe33 100644 > --- a/framework/dts.py > +++ b/framework/dts.py > @@ -42,7 +42,7 @@ import rst # rst file support > from crbs import crbs > from tester import Tester > from dut import Dut > -from settings import NICS, DRIVERS > +from settings import FOLDERS, NICS, DRIVERS > from serializer import Serializer > from exception import VerifyFailure > from test_case import TestCase > @@ -128,7 +128,7 @@ def close_crb_sessions(): > dut.close() > if tester is not None: > tester.close() > - log_handler.info("DTF ended") > + log_handler.info("DTS ended") >=20 >=20 > def get_nic_driver(pci_id): > @@ -401,10 +401,18 @@ def run_all(config_file, pkgName, git, patch, > skip_setup, > global stats > global log_handler >=20 > + # change operation directory > + os.chdir("../") > + > # prepare the output folder > if not os.path.exists(output_dir): > os.mkdir(output_dir) >=20 > + # add python module search path > + for folder in FOLDERS.values(): > + sys.path.append(folder) > + sys.path.append(suite_dir) > + > # init log_handler handler > if verbose is True: > logger.set_verbose() > @@ -423,7 +431,6 @@ def run_all(config_file, pkgName, git, patch, > skip_setup, > # register exit action > atexit.register(close_crb_sessions) >=20 > - sys.path.append(suite_dir) > os.environ["TERM"] =3D "dumb" >=20 > serializer =3D Serializer() > diff --git a/framework/main.py b/framework/main.py > index 21815dd..d38aa8a 100755 > --- a/framework/main.py > +++ b/framework/main.py > @@ -47,9 +47,9 @@ def git_build_package(gitLabel, gitPkg, output): > gitURL =3D r"http://dpdk.org/git/dpdk" > gitPrefix =3D r"dpdk/" > print "git clone %s %s/%s" % (gitURL, output, gitPrefix) > - os.system("git clone %s ../output/%s" % (gitURL, gitPrefix)) > - print "git archive --format=3Dtar.gz --prefix=3D%s %s -o ../%s" % > (gitPrefix, gitLabel, gitPkg) > - os.system("cd ../output/%s && git archive --format=3Dtar.gz -- > prefix=3D%s %s -o ../%s" % (gitPrefix, gitPrefix, gitLabel, gitPkg)) > + os.system("git clone %s output/%s" % (gitURL, gitPrefix)) > + print "git archive --format=3Dtar.gz --prefix=3D%s %s -o %s" % (gitP= refix, > gitLabel, gitPkg) > + os.system("cd output/%s && git archive --format=3Dtar.gz --prefix=3D= %s %s > -o %s" % (gitPrefix, gitPrefix, gitLabel, gitPkg)) >=20 > # > # Main program begins here > @@ -60,7 +60,7 @@ def git_build_package(gitLabel, gitPkg, output): > parser =3D argparse.ArgumentParser(description=3D'DPDK test framework.') >=20 > parser.add_argument('--config-file', > - default=3D'../execution.cfg', > + default=3D'execution.cfg', > help=3D'configuration file that describes the test '= + > 'cases, DUTs and targets') >=20 > @@ -72,11 +72,11 @@ parser.add_argument('--patch', > help=3D'apply a patch to the package under test') >=20 > parser.add_argument('--snapshot', > - default=3D'../dpdk.tar.gz', > + default=3D'dpdk.tar.gz', > help=3D'snapshot .tgz file to use as input') >=20 > parser.add_argument('--output', > - default=3D'../output', > + default=3D'output', > help=3D'Output directory where dts log and result > saved') >=20 > parser.add_argument('-s', '--skip-setup', > @@ -95,7 +95,7 @@ parser.add_argument('-p', '--project', > help=3D'specify that which project will be tested') >=20 > parser.add_argument('--suite-dir', > - default=3D'../tests', > + default=3D'tests', > help=3D'Test suite directory where test suites will = be > imported') >=20 > parser.add_argument('-t', '--test-cases', > diff --git a/framework/rst.py b/framework/rst.py > index 8c2d6c5..9b8eb69 100644 > --- a/framework/rst.py > +++ b/framework/rst.py > @@ -52,8 +52,8 @@ Result: > Result: PASS > """ >=20 > -path2Plan =3D '../test_plans' > -path2Result =3D '../output' > +path2Plan =3D 'test_plans' > +path2Result =3D 'output' > rstName =3D "" > rstAnnexName =3D "" >=20 > diff --git a/framework/settings.py b/framework/settings.py > index 40b81fb..e4ca5dd 100644 > --- a/framework/settings.py > +++ b/framework/settings.py > @@ -28,6 +28,14 @@ > # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > +""" > +Folders for framework running enviornment. > +""" > +FOLDERS =3D { > + 'Framework' : 'framework', > + 'Testscripts' : 'tests', > + 'Configuration' : 'conf', > +} >=20 > """ > Nics and its identifiers supported by the framework. > -- > 1.9.3