test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/perf_virtio_user: fix issue of the json per patch result report in output
@ 2020-02-24  1:53 lihong
  2020-02-24  9:23 ` Ma, LihongX
  2020-02-25  1:29 ` Tu, Lijuan
  0 siblings, 2 replies; 4+ messages in thread
From: lihong @ 2020-02-24  1:53 UTC (permalink / raw)
  To: dts; +Cc: lihong

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 tests/TestSuite_perf_virtio_user_loopback.py | 12 ++++++------
 tests/TestSuite_perf_virtio_user_pvp.py      | 15 +++++++--------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/tests/TestSuite_perf_virtio_user_loopback.py b/tests/TestSuite_perf_virtio_user_loopback.py
index 15bc54c..0fb97dd 100644
--- a/tests/TestSuite_perf_virtio_user_loopback.py
+++ b/tests/TestSuite_perf_virtio_user_loopback.py
@@ -71,6 +71,7 @@ class TestPerfVirtioUserLoopback(TestCase):
         self.vhost = self.dut.new_session(suite="vhost")
         self.virtio_user = self.dut.new_session(suite="virtio-user")
         self.save_result_flag = True
+        self.json_obj = dict()
 
     def set_up(self):
         """
@@ -237,9 +238,8 @@ class TestPerfVirtioUserLoopback(TestCase):
         self.nic+_single_core_perf.json in output folder
         if self.save_result_flag is True
         '''
-        json_obj = dict()
         case_name = self.running_case
-        json_obj[case_name] = list()
+        self.json_obj[case_name] = list()
         status_result = []
         for frame_size in self.test_parameters.keys():
             for nb_desc in self.test_parameters[frame_size]:
@@ -268,12 +268,12 @@ class TestPerfVirtioUserLoopback(TestCase):
                 row_dict0['performance'].append(row_dict1)
                 row_dict0['parameters'].append(row_dict2)
                 row_dict0['parameters'].append(row_dict3)
-                json_obj[case_name].append(row_dict0)
+                self.json_obj[case_name].append(row_dict0)
                 status_result.append(row_dict0['status'])
         with open(os.path.join(rst.path2Result,
-                               '{0:s}_vhost_loopback_performance_virtio_user.json'.format(
-                                   self.nic)), 'w') as fp:
-            json.dump(json_obj, fp)
+                               '{0:s}_{1}.json'.format(
+                                   self.nic, self.suite_name)), 'w') as fp:
+            json.dump(self.json_obj, fp)
         self.verify("Fail" not in status_result, "Exceeded Gap")
 
     def test_perf_loopback_packed_ring_inorder_mergeable(self):
diff --git a/tests/TestSuite_perf_virtio_user_pvp.py b/tests/TestSuite_perf_virtio_user_pvp.py
index d49bd19..2073426 100644
--- a/tests/TestSuite_perf_virtio_user_pvp.py
+++ b/tests/TestSuite_perf_virtio_user_pvp.py
@@ -42,7 +42,6 @@ from test_case import TestCase
 from packet import Packet
 from settings import UPDATE_EXPECTED, load_global_setting
 from copy import deepcopy
-from prettytable import PrettyTable
 
 
 class TestVirtioSingleCorePerf(TestCase):
@@ -63,6 +62,7 @@ class TestVirtioSingleCorePerf(TestCase):
         self.save_result_flag = True
         socket_num = len(set([int(core['socket']) for core in self.dut.cores]))
         self.socket_mem = ','.join(['1024']*socket_num)
+        self.json_obj = dict()
 
     def set_up(self):
         """
@@ -332,12 +332,11 @@ class TestVirtioSingleCorePerf(TestCase):
     def save_result(self, data):
         '''
         Saves the test results as a separated file named with
-        self.nic+_single_core_perf.json in output folder
+        self.nic+_perf_virtio_user_pvp.json in output folder
         if self.save_result_flag is True
         '''
-        json_obj = dict()
         case_name = self.running_case
-        json_obj[case_name] = list()
+        self.json_obj[case_name] = list()
         status_result = []
         for frame_size in self.test_parameters.keys():
             for nb_desc in self.test_parameters[frame_size]:
@@ -366,12 +365,12 @@ class TestVirtioSingleCorePerf(TestCase):
                 row_dict0['performance'].append(row_dict1)
                 row_dict0['parameters'].append(row_dict2)
                 row_dict0['parameters'].append(row_dict3)
-                json_obj[case_name].append(row_dict0)
+                self.json_obj[case_name].append(row_dict0)
                 status_result.append(row_dict0['status'])
         with open(os.path.join(rst.path2Result,
-                               '{0:s}_single_core_perf.json'.format(
-                                   self.nic)), 'w') as fp:
-            json.dump(json_obj, fp)
+                               '{0:s}_{1}.json'.format(
+                                   self.nic, self.suite_name)), 'w') as fp:
+            json.dump(self.json_obj, fp)
         self.verify("Fail" not in status_result, "Exceeded Gap")
 
     def tear_down(self):
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-25  1:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24  1:53 [dts] [PATCH V1] tests/perf_virtio_user: fix issue of the json per patch result report in output lihong
2020-02-24  9:23 ` Ma, LihongX
2020-02-25  1:29   ` Tu, Lijuan
2020-02-25  1:29 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).