From: Ross Brattain Date: Tue, 29 Aug 2017 23:31:59 +0000 (-0700) Subject: sample_vnf: run_traffic loop, check if tg_process is alive X-Git-Tag: opnfv-5.0.RC1~212^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=da0f85b717bba64d4905542d74fd9b4b945647c3;p=yardstick.git sample_vnf: run_traffic loop, check if tg_process is alive 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 --- diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index 7a756837e..d7874a1a4 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -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()