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

Patrick MacArthur pmacarth at iol.unh.edu
Thu Mar 29 21:16:02 CEST 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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py
index 21de93624cb4..860fc29f607f 100644
--- a/tests/TestSuite_nic_single_core_perf.py
+++ b/tests/TestSuite_nic_single_core_perf.py
@@ -33,6 +33,7 @@ DPDK Test suite.
 """
 
 import utils
+import os
 import re
 import time
 from test_case import TestCase
@@ -41,6 +42,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 +246,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