[Fuego] [PATCH 1/3] ftc: gen-report: Add support getting report_dir from -o, option
Tim.Bird at sony.com
Tim.Bird at sony.com
Tue Mar 20 21:20:52 UTC 2018
Looks good. Applied.
-- Tim
> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> Sent: Tuesday, March 13, 2018 3:16 AM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 1/3] ftc: gen-report: Add support getting report_dir
> from -o, option
>
> The default value of report_dir is /fuego-rw/reports/.
> Now, We can use -o option to override the report_dir variable
>
> Signed-off-by: Hoang Van Tuyen <tuyen.hoangvan at toshiba-tsdv.com>
> <mailto:tuyen.hoangvan at toshiba-tsdv.com>
> ---
> engine/scripts/ftc | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/engine/scripts/ftc b/engine/scripts/ftc
> index 3263fe6..7fa0333 100755
> --- a/engine/scripts/ftc
> +++ b/engine/scripts/ftc
> @@ -299,6 +299,7 @@ the 'foo' function from the board file, you would use
> do this:
> [--header_fields <field_list>] \\
> [--fields <field_list>] \\
> [--layout <report_name>]
> + [-o report_dir]
>
> Generates a report from test run data as specified. The where option
> controls which runs are included in the report. The format option controls
> @@ -2225,8 +2226,17 @@ def do_gen_report(conf, options):
>
> # create a directory to save report files
> report_dir = "/fuego-rw/reports/"
> - if not os.path.exists(report_dir):
> - os.makedirs(report_dir)
> + if "-o" in options:
> + report_dir = options[options.index("-o")+1]
> + options.remove(report_dir)
> + options.remove("-o")
> + try:
> + if not os.path.isdir(report_dir):
> + os.mkdir(report_dir)
> + except:
> + # Sometimes value of report_dir exists like a file or something which
> + # make we cannot create a directory.
> + error_out("Invalid report directory '%s'" % report_dir)
>
> # get data for report
> header_data = get_report_header_data(run_list, run_map,
> header_fields)
> --
> 2.1.4
>
>
>
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org <mailto:Fuego at lists.linuxfoundation.org>
> https://lists.linuxfoundation.org/mailman/listinfo/fuego
More information about the Fuego
mailing list