[NFVBENCH-67] NFVbench should have same TX rate for different rate formats 71/52271/1
authorYichen Wang <yicwang@cisco.com>
Fri, 16 Feb 2018 23:09:00 +0000 (15:09 -0800)
committerYichen Wang <yicwang@cisco.com>
Fri, 16 Feb 2018 23:09:41 +0000 (15:09 -0800)
Change-Id: I55e03319efba353dd3067b8b946815b631a87896
Signed-off-by: Yichen Wang <yicwang@cisco.com>
nfvbench/traffic_client.py

index 57141be..bdcc027 100755 (executable)
@@ -518,6 +518,10 @@ class TrafficClient(object):
             unidir_reverse_pps = int(self.config.unidir_reverse_traffic_pps)
             if unidir_reverse_pps > 0:
                 self.run_config['rates'].append({'rate_pps': str(unidir_reverse_pps)})
+        # Fix for [NFVBENCH-67], convert the rate string to PPS
+        for idx, rate in enumerate(self.run_config['rates']):
+            if 'rate_pps' not in rate:
+                self.run_config['rates'][idx] = {'rate_pps': self.__convert_rates(rate)['rate_pps']}
 
         self.gen.clear_streamblock()
         self.gen.create_traffic(frame_size, self.run_config['rates'], bidirectional, latency=True)