summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-09-26 23:02:15 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-30 01:23:07 -0700
commit25eccae14eadc2cfe6ae6a3aff6087e0c324145d (patch)
tree08ac7af8fdb9c34812398553ec3ac9e1d54e4a0e
parent89b0554ab04d41ad0768aea15c2cdf2bd67f1862 (diff)
Terminate the run traffic if initiated after traffic is closed
Change-Id: I89fc4bccb5b5a0d49d804fca72b59e53ff77a805 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
index 12266d6ad..22aaf6dfb 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
@@ -170,24 +170,25 @@ class IxiaResourceHelper(ClientResourceHelper):
self.client.ix_stop_traffic()
self._queue.put(samples)
- except Exception:
- LOG.exception("Run Traffic terminated")
- if not self.rfc_helper.is_done():
- self._terminated.value = 1
- return
+ if not self.rfc_helper.is_done():
+ self._terminated.value = 1
+ return
+
+ traffic_profile.execute_traffic(self, self.client, mac, ixia_file)
+ for _ in range(5):
+ time.sleep(self.LATENCY_TIME_SLEEP)
+ self.client.ix_stop_traffic()
+ samples = self.generate_samples(traffic_profile.ports, 'latency', {})
+ self._queue.put(samples)
+ traffic_profile.start_ixia_latency(self, self.client, mac, ixia_file)
+ if self._terminated.value:
+ break
- traffic_profile.execute_traffic(self, self.client, mac, ixia_file)
- for _ in range(5):
- time.sleep(self.LATENCY_TIME_SLEEP)
self.client.ix_stop_traffic()
- samples = self.generate_samples(traffic_profile.ports, 'latency', {})
- self._queue.put(samples)
- traffic_profile.start_ixia_latency(self, self.client, mac, ixia_file)
- if self._terminated.value:
- break
+ except Exception:
+ LOG.exception("Run Traffic terminated")
- self.client.ix_stop_traffic()
self._terminated.value = 1
def collect_kpi(self):