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 DA6BA5A52 for ; Thu, 9 Jul 2015 09:59:11 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 09 Jul 2015 00:59:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,438,1432623600"; d="scan'208";a="521249199" Received: from pgsmsx105.gar.corp.intel.com ([10.221.44.96]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jul 2015 00:59:10 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX105.gar.corp.intel.com (10.221.44.96) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 9 Jul 2015 15:59:09 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.46]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.157]) with mapi id 14.03.0224.002; Thu, 9 Jul 2015 15:59:02 +0800 From: "Liu, Yong" To: "Tang, HaifengX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] Change output folder path and optimize virt dut log Thread-Index: AQHQuh0JGERMUCf+kUe/YFsEoUx0gp3SxepA Date: Thu, 9 Jul 2015 07:59:01 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E5D53A@SHSMSX103.ccr.corp.intel.com> References: <1436159056-1443-1-git-send-email-yong.liu@intel.com> In-Reply-To: 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] Change output folder path and optimize virt dut log 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: Thu, 09 Jul 2015 07:59:12 -0000 Ok, I'll changed output folder back to default. > -----Original Message----- > From: Tang, HaifengX > Sent: Thursday, July 09, 2015 3:58 PM > To: Liu, Yong; dts@dpdk.org > Cc: Tang, HaifengX > Subject: RE: [dts] [PATCH] Change output folder path and optimize virt du= t > log >=20 >=20 > Hi yong: >=20 > In these patch: > # prepare the output folder > + if output_dir =3D=3D '': > + output_dir =3D time.strftime("output/%Y_%m_%d_%H_%M_%S") > + >=20 > In my opinion , can we remove these code? > Get the timestamp from dut or tester to create a new folder for saving > current > Test result make a great issue for our auto-regression test. >=20 > thanks >=20 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu > Sent: Monday, July 06, 2015 1:04 PM > To: dts@dpdk.org > Subject: [dts] [PATCH] Change output folder path and optimize virt dut lo= g >=20 > From: Marvin Liu >=20 > Previously all output files will be saved in output folder dts.log and > "suite.log". The log information will be appended in the log file. The lo= g > file will be huge and difficult to trace after running dts several times. >=20 > Now log files will be saved in output/folder_name_by_time. >=20 > Signed-off-by: Marvin Liu >=20 > diff --git a/framework/dts.py b/framework/dts.py index b843f22..c4f4663 > 100644 > --- a/framework/dts.py > +++ b/framework/dts.py > @@ -38,6 +38,7 @@ import inspect # load attribute > import atexit # register callback when exit > import json # json format > import signal # signal module for debug mode > +import time # time module for unique output folder >=20 > import rst # rst file support > from crbs import crbs > @@ -74,6 +75,7 @@ functional_only =3D False nic =3D None requested_test= s =3D > None dut =3D None > +duts =3D None > tester =3D None > result =3D None > excel_report =3D None > @@ -192,11 +194,15 @@ def dts_log_testsuite(test_suite, log_handler, > test_classname): > """ > Change to SUITE self logger handler. > """ > + global duts > test_suite.logger =3D getLogger(test_classname) > test_suite.logger.config_suite(test_classname) > log_handler.config_suite(test_classname, 'dts') > dut.logger.config_suite(test_classname, 'dut') > tester.logger.config_suite(test_classname, 'tester') > + if duts and len(duts): > + for crb in duts: > + crb.logger.config_suite(test_classname, 'virtdut') > try: > if tester.it_uses_external_generator(): > getattr(tester, 'ixia_packet_gen') @@ -212,6 +218,9 @@ def > dts_log_execution(log_handler): > log_handler.config_execution('dts') > dut.logger.config_execution('dut') > tester.logger.config_execution('tester') > + if duts and len(duts): > + for crb in duts: > + crb.logger.config_execution('virtdut') > try: > if tester.it_uses_external_generator(): > getattr(tester, 'ixia_packet_gen') @@ -279,8 +288,8 @@ def > dts_run_target(crbInst, targets, test_suites, nic, scenario): > scene =3D None >=20 > if scene: > - scene.load_config() > - scene.create_scene() > + scene.load_config() > + scene.create_scene() >=20 > for target in targets: > log_handler.info("\nTARGET " + target) @@ -332,6 +341,7 @@ def > dts_run_suite(crbInst, test_suites, target, nic, scene): > for test_classname, test_class in get_subclasses(test_module= , > TestCase): >=20 > if scene and scene.vm_dut_enable: > + global duts > duts =3D scene.get_vm_duts() > tester.dut =3D duts[0] > test_suite =3D test_class(duts[0], tester, target, > test_suite) @@ -389,6 +399,9 @@ def run_all(config_file, pkgName, git, > patch, skip_setup, > Patches =3D patch >=20 > # prepare the output folder > + if output_dir =3D=3D '': > + output_dir =3D time.strftime("output/%Y_%m_%d_%H_%M_%S") > + > if not os.path.exists(output_dir): > os.mkdir(output_dir) >=20 > diff --git a/framework/main.py b/framework/main.py index 6b771a5..69d2318 > 100755 > --- a/framework/main.py > +++ b/framework/main.py > @@ -84,7 +84,7 @@ parser.add_argument('--snapshot', > help=3D'snapshot .tgz file to use as input') >=20 > parser.add_argument('--output', > - default=3D'output', > + default=3D'', > help=3D'Output directory where dts log and result > saved') >=20 > parser.add_argument('-s', '--skip-setup', diff --git > a/framework/virt_dut.py b/framework/virt_dut.py index 2edbf6f..5e4d212 > 100644 > --- a/framework/virt_dut.py > +++ b/framework/virt_dut.py > @@ -63,7 +63,7 @@ class VirtDut(DPDKdut): > # load port config from suite cfg > self.suite =3D suite > self.logger =3D getLogger(self.NAME) > - self.logger.config_execution('vmdut') > + self.logger.config_suite(suite, 'virtdut') > self.session =3D SSHConnection(self.vm_ip, self.NAME, > self.get_password()) > self.session.init_log(self.logger) > -- > 1.9.3