NFVi Test stops after one hour even if configured context duration is longer 21/52821/5
authorDanielMartinBuckley <daniel.m.buckley@intel.com>
Wed, 28 Feb 2018 11:55:44 +0000 (11:55 +0000)
committerDanielMartinBuckley <daniel.m.buckley@intel.com>
Wed, 7 Mar 2018 15:19:54 +0000 (15:19 +0000)
JIRA: YARDSTICK-1021

If the Test is to take longer than the Default Duration timer use
defined test time.
If not use Default Duration time

Change-Id: Idacc188e199ff031310b9826238b63ed3f2ea409
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
yardstick/network_services/vnf_generic/vnf/sample_vnf.py

index d57d7e6..8d02446 100644 (file)
@@ -626,8 +626,10 @@ class ScenarioHelper(object):
 
     @property
     def timeout(self):
-        return self.options.get('timeout', DEFAULT_VNF_TIMEOUT)
-
+        test_duration = self.scenario_cfg.get('runner', {}).get('duration',
+            self.options.get('timeout', DEFAULT_VNF_TIMEOUT))
+        test_timeout = self.options.get('timeout', DEFAULT_VNF_TIMEOUT)
+        return test_duration if test_duration > test_timeout else test_timeout
 
 class SampleVNF(GenericVNF):
     """ Class providing file-like API for generic VNF implementation """