Store packetsize in influxdb 19/32519/3
authorJing Zhang <jing.c.zhang@nokia.com>
Thu, 30 Mar 2017 13:26:55 +0000 (09:26 -0400)
committerRoss Brattain <ross.b.brattain@intel.com>
Fri, 31 Mar 2017 04:24:30 +0000 (04:24 +0000)
This allows calculating throughput in Gbps.

Add: test_pktgen.py

Change-Id: I7e2132ec71985c14570ef18b952b2264ebf7abbc
JIRA: YARKSTICK-611
Signed-off-by: Jing Zhang <jing.c.zhang@nokia.com>
tests/unit/benchmark/scenarios/networking/test_pktgen.py
yardstick/benchmark/scenarios/networking/pktgen.py

index f50fa10..989c5b7 100644 (file)
@@ -132,7 +132,7 @@ class PktgenTestCase(unittest.TestCase):
         p._iptables_get_result = mock_iptables_result
 
         sample_output = '{"packets_per_second": 9753, "errors": 0, \
-            "packets_sent": 149776, "flows": 110}'
+            "packets_sent": 149776, "packetsize": 60, "flows": 110}'
         mock_ssh.SSH().execute.return_value = (0, sample_output, '')
 
         p.run(result)
@@ -158,7 +158,7 @@ class PktgenTestCase(unittest.TestCase):
         p._iptables_get_result = mock_iptables_result
 
         sample_output = '{"packets_per_second": 9753, "errors": 0, \
-            "packets_sent": 149776, "flows": 110}'
+            "packets_sent": 149776, "packetsize": 60, "flows": 110}'
         mock_ssh.SSH().execute.return_value = (0, sample_output, '')
 
         p.run(result)
@@ -184,7 +184,7 @@ class PktgenTestCase(unittest.TestCase):
         p._iptables_get_result = mock_iptables_result
 
         sample_output = '{"packets_per_second": 9753, "errors": 0, \
-            "packets_sent": 149776, "flows": 110}'
+            "packets_sent": 149776, "packetsize": 60, "flows": 110}'
         mock_ssh.SSH().execute.return_value = (0, sample_output, '')
         self.assertRaises(AssertionError, p.run, result)
 
index b61337a..9a8725c 100644 (file)
@@ -137,6 +137,7 @@ class Pktgen(base.Scenario):
         result.update(jsonutils.loads(stdout))
 
         result['packets_received'] = self._iptables_get_result()
+        result['packetsize'] = packetsize
 
         if "sla" in self.scenario_cfg:
             sent = result['packets_sent']