From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2630BA00E6 for ; Mon, 13 May 2019 09:49:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A4984C95; Mon, 13 May 2019 09:49:46 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DAC412BCE for ; Mon, 13 May 2019 09:49:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2019 00:49:42 -0700 X-ExtLoop1: 1 Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 13 May 2019 00:49:43 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 13 May 2019 00:49:42 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 13 May 2019 00:49:42 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.7]) with mapi id 14.03.0415.000; Mon, 13 May 2019 15:49:40 +0800 From: "Tu, Lijuan" To: Rami Rosen , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 1/1] framework: add a new subtitle paramater Thread-Index: AQHVAamrmxuyIzrCFkC5a0AG7aCM1KZovX4Q Date: Mon, 13 May 2019 07:49:40 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA7FDAF@SHSMSX101.ccr.corp.intel.com> References: <1556885590-33513-1-git-send-email-ramirose@gmail.com> In-Reply-To: <1556885590-33513-1-git-send-email-ramirose@gmail.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTVhZGMwNGYtMDllZC00YjlhLTk2ZmEtZDdlYzg5NDg0YjgwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNm81Q0NGcCtKUGpSaTd2eE1Tdk0rQTIwcmhuazJOVjVCSk1QdEpyYmY0SnliVW9ZeWVWc0hUR2VOSzVLTyt0WSJ9 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 1/1] framework: add a new subtitle paramater 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Rami Rosen > Sent: Friday, May 3, 2019 8:13 PM > To: dts@dpdk.org > Cc: Rami Rosen > Subject: [dts] [PATCH 1/1] framework: add a new subtitle paramater >=20 > Add a new subtitle paramater to main. There are use cases when we want to > add specific details to the rst report, for example, FW version, name of = the > relevant project, setup details, etc. This patch provides this ability. W= ith this > patch, you can run, for exampe: >=20 > ./dts -s --config-file=3Dexecution.cfg --subtitle=3DFW_1.8.0 >=20 > to add FW_1.8.0 in the rst report. >=20 > Signed-off-by: Rami Rosen > --- > framework/dts.py | 11 ++++++----- > framework/main.py | 5 ++++- > framework/rst.py | 5 +++++ > framework/test_case.py | 8 ++++++++ > 4 files changed, 23 insertions(+), 6 deletions(-) >=20 > diff --git a/framework/dts.py b/framework/dts.py index 19a473d..c622e19 > 100644 > --- a/framework/dts.py > +++ b/framework/dts.py > @@ -351,7 +351,7 @@ def dts_run_prerequisties(duts, tester, pkgName, > patch, dts_commands, serializer > return False >=20 >=20 > -def dts_run_target(duts, tester, targets, test_suites): > +def dts_run_target(duts, tester, targets, test_suites, subtitle): > """ > Run each target in execution targets. > """ > @@ -378,7 +378,7 @@ def dts_run_target(duts, tester, targets, test_suites= ): > result.add_failed_target(result.dut, target, str(ex)) > continue >=20 > - dts_run_suite(duts, tester, test_suites, target) > + dts_run_suite(duts, tester, test_suites, target, subtitle) >=20 > tester.restore_interfaces() >=20 > @@ -388,7 +388,7 @@ def dts_run_target(duts, tester, targets, test_suites= ): > dutobj.restore_modules() >=20 >=20 > -def dts_run_suite(duts, tester, test_suites, target): > +def dts_run_suite(duts, tester, test_suites, target, subtitle): > """ > Run each suite in test suite list. > """ > @@ -402,6 +402,7 @@ def dts_run_suite(duts, tester, test_suites, target): > suite_obj.init_log() > suite_obj.set_requested_cases(requested_tests) > suite_obj.set_check_inst(check=3Dcheck_case_inst) > + suite_obj.set_subtitle(subtitle) > result.nic =3D suite_obj.nic >=20 > dts_log_testsuite(duts, tester, suite_obj, log_handler, > test_classname) @@ -439,7 +440,7 @@ def dts_run_suite(duts, tester, > test_suites, target): > def run_all(config_file, pkgName, git, patch, skip_setup, > read_cache, project, suite_dir, test_cases, > base_dir, output_dir, verbose, virttype, debug, > - debugcase, re_run, commands): > + debugcase, re_run, commands, subtitle): > """ > Main process of DTS, it will run all test suites in the config file. > """ > @@ -560,7 +561,7 @@ def run_all(config_file, pkgName, git, patch, > skip_setup, > dts_crbs_exit(duts, tester) > continue >=20 > - dts_run_target(duts, tester, targets, test_suites) > + dts_run_target(duts, tester, targets, test_suites, subtitle) >=20 > dts_crbs_exit(duts, tester) >=20 > diff --git a/framework/main.py b/framework/main.py index > 0aa54fd..b91a889 100755 > --- a/framework/main.py > +++ b/framework/main.py > @@ -143,6 +143,9 @@ parser.add_argument('--commands', > help=3D'run command on tester or dut. The command fo= rmat is ' + > '[commands]:dut|tester:pre-init|post-init:check|igno= re') >=20 > +parser.add_argument('--subtitle', > + help=3D'add a subtitle to the rst report') > + > args =3D parser.parse_args() >=20 >=20 > @@ -159,4 +162,4 @@ 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, > args.dir, args.output, args.verbose,args.virttype, > - args.debug, args.debugcase, args.re_run, args.commands) > + args.debug, args.debugcase, args.re_run, args.commands, > + args.subtitle) > diff --git a/framework/rst.py b/framework/rst.py index ef1825c..2f36ab1 > 100644 > --- a/framework/rst.py > +++ b/framework/rst.py > @@ -107,6 +107,11 @@ class RstReport(object): > f.write(line) > f.write('-' * len(line) + '\n') >=20 > + def write_subtitle(self): > + if self._subtitle is not None: > + with open(self.rstName, "a") as f: > + f.write("%s\n" % self._subtitle) > + > def write_annex_title(self, text): > """ > write annex to test case title Annex to #Name# diff --git > a/framework/test_case.py b/framework/test_case.py index > 7402631..27d236b 100644 > --- a/framework/test_case.py > +++ b/framework/test_case.py > @@ -58,6 +58,7 @@ class TestCase(object): >=20 > # local variable > self._requested_tests =3D None > + self._subtitle =3D None >=20 > # check session and reconnect if possible > for dutobj in self.duts: > @@ -219,6 +220,13 @@ class TestCase(object): > """ > self._requested_tests =3D case_list >=20 > + def set_subtitle(self, subtitle): > + """ > + Pass down subtitle for Rst report > + """ > + self._rst_obj._subtitle =3D subtitle > + self._rst_obj.write_subtitle() > + > def _get_test_cases(self, test_name_regex): > """ > Return case list which name matched regex. > -- > 1.8.3.1