sample_vnf: run_traffic loop, check if tg_process is alive 67/40667/2
authorRoss Brattain <ross.b.brattain@intel.com>
Tue, 29 Aug 2017 23:31:59 +0000 (16:31 -0700)
committerRoss Brattain <ross.b.brattain@intel.com>
Wed, 30 Aug 2017 16:41:32 +0000 (16:41 +0000)
if the tg_process crashes, this loop won't terminate unless
we check tg_process.is_alive()

wait 1 second before checking in case is_alive needs time
to become True

Change-Id: Ia0b8fd884dcfeb75ebb8e36caaf1f0b70dab079d
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
yardstick/network_services/vnf_generic/vnf/sample_vnf.py

index 7a75683..d7874a1 100644 (file)
@@ -966,6 +966,9 @@ class SampleVNFTrafficGen(GenericTrafficGen):
         # Wait for traffic process to start
         while self.resource_helper.client_started.value == 0:
             time.sleep(self.RUN_WAIT)
+            # what if traffic process takes a few seconds to start?
+            if not self._traffic_process.is_alive():
+                break
 
         return self._traffic_process.is_alive()