Merge "Added traffic update capability to Ixload TG"
[yardstick.git] / yardstick / benchmark / scenarios / networking / vnf_generic.py
index 10f10d4..20fff61 100644 (file)
@@ -63,6 +63,9 @@ class NetworkServiceTestCase(scenario_base.Scenario):
         self.bin_path = get_nsb_option('bin_path', '')
         self._mq_ids = []
 
+    def is_ended(self):
+        return self.traffic_profile is not None and self.traffic_profile.is_ended()
+
     def _get_ip_flow_range(self, ip_start_range):
         """Retrieve a CIDR first and last viable IPs
 
@@ -117,8 +120,15 @@ class NetworkServiceTestCase(scenario_base.Scenario):
             for index, dst_port in enumerate(fflow.get("dst_port", [])):
                 flow["dst_port_{}".format(index)] = dst_port
 
-            flow["count"] = fflow["count"]
-            flow["seed"] = fflow["seed"]
+            if "count" in fflow:
+                flow["count"] = fflow["count"]
+
+            if "srcseed" in fflow:
+                flow["srcseed"] = fflow["srcseed"]
+
+            if "dstseed" in fflow:
+                flow["dstseed"] = fflow["dstseed"]
+
         except KeyError:
             flow = {}
         return {"flow": flow}