results: Write trafficgen results into CSV 67/15967/1
authorMartin Klozik <martinx.klozik@intel.com>
Thu, 23 Jun 2016 09:01:27 +0000 (10:01 +0100)
committerMartin Klozik <martinx.klozik@intel.com>
Thu, 23 Jun 2016 11:25:47 +0000 (12:25 +0100)
Write test results provided by traffic generator into CSV file
also in case, that trafficgen mode is selected.

JIRA: VSPERF-288

Change-Id: Ib55f9f81aadef7dd20a5dce4b000dc2c9607cb95
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
testcases/integration.py
testcases/testcase.py
vsperf

index 9733c26..fdd8b09 100644 (file)
@@ -191,7 +191,7 @@ class IntegrationTestCase(TestCase):
             results = OrderedDict()
             results['status'] = 'OK' if self._inttest['status'] else 'FAILED'
             results['details'] = self._inttest['details']
-            TestCase._write_result_to_file([results], self._output_file)
+            TestCase.write_result_to_file([results], self._output_file)
             self.report_status("Test '{}'".format(self.name), self._inttest['status'])
             # inform vsperf about testcase failure
             if not self._inttest['status']:
index 9441632..e5f8a14 100644 (file)
@@ -245,7 +245,7 @@ class TestCase(object):
             self._traffic_ctl.print_results()
 
             self._tc_results = self._append_results(self._traffic_ctl.get_results())
-            TestCase._write_result_to_file(self._tc_results, self._output_file)
+            TestCase.write_result_to_file(self._tc_results, self._output_file)
 
     def run(self):
         """Run the test
@@ -392,7 +392,7 @@ class TestCase(object):
             self._hugepages_mounted = False
 
     @staticmethod
-    def _write_result_to_file(results, output):
+    def write_result_to_file(results, output):
         """Write list of dictionaries to a CSV file.
 
         Each element on list will create separate row in output file.
diff --git a/vsperf b/vsperf
index 789e5df..f2f443b 100755 (executable)
--- a/vsperf
+++ b/vsperf
@@ -622,6 +622,10 @@ def main():
             traffic_ctl.send_traffic(traffic)
         _LOGGER.debug("Traffic Results:")
         traffic_ctl.print_results()
+
+        # write results into CSV file
+        result_file = os.path.join(results_path, "result.csv")
+        PerformanceTestCase.write_result_to_file(traffic_ctl.get_results(), result_file)
     else:
         # configure tests
         if args['integration']: