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

Patrick MacArthur pmacarth at iol.unh.edu
Tue Mar 20 23:20:40 CET 2018


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