[dts] [PATCH for-next v2 4/5] tests/TestSuite_nic_single_core_perf: Use user-specified output dir

Ali Alnubani alialnu at mellanox.com
Wed Mar 28 18:19:07 CEST 2018


Hi Patrick,
You are using os module w/o it being imported in this patch.

Thanks,
Ali

> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Patrick MacArthur
> Sent: Wednesday, March 21, 2018 12:21 AM
> To: dts at dpdk.org
> Cc: dpdklab at iol.unh.edu
> Subject: [dts] [PATCH for-next v2 4/5] tests/TestSuite_nic_single_core_perf:
> Use user-specified output dir
> 
> The user can override the default output directory via a command line
> argument, but this script does not account for that. Fix the script to look up
> the output directory that the user requested and place the custom output
> file in that directory.
> 
> Tested-by: Ali Alnubani <alialnu at mellanox.com>
> Signed-off-by: Patrick MacArthur <pmacarth at iol.unh.edu>
> ---
>  tests/TestSuite_nic_single_core_perf.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/TestSuite_nic_single_core_perf.py
> b/tests/TestSuite_nic_single_core_perf.py
> index 21de93624cb4..bff763c129fa 100644
> --- a/tests/TestSuite_nic_single_core_perf.py
> +++ b/tests/TestSuite_nic_single_core_perf.py
> @@ -41,6 +41,7 @@ from settings import HEADER_SIZE  from pmd_output
> import PmdOutput  from copy import deepcopy  from prettytable import
> PrettyTable
> +import rst
> 
>  class TestNicSingleCorePerf(TestCase):
> 
> @@ -244,7 +245,8 @@ class TestNicSingleCorePerf(TestCase):
> 
> table_row.append(self.test_result[frame_size][descriptor][header[3]])
> 
> table_row.append(self.test_result[frame_size][descriptor][header[4]])
>                  table.add_row(table_row)
> -        file_to_save = open("output/%s_single_core_perf.txt" % self.nic, 'w')
> +        file_to_save = open(os.path.join(
> +            rst.path2Result, "%s_single_core_perf.txt" % self.nic),
> + 'w')
>          file_to_save.write(str(table))
>          file_to_save.close()
> 
> --
> 2.14.1



More information about the dts mailing list