add a way to load default args from config file
authorHanoh Haim <[email protected]>
Tue, 15 Nov 2016 14:33:03 +0000 (16:33 +0200)
committerHanoh Haim <[email protected]>
Tue, 15 Nov 2016 15:42:51 +0000 (17:42 +0200)
Signed-off-by: Hanoh Haim <[email protected]>
scripts/automation/regression/stateful_tests/trex_general_test.py

index e968d38..1843af0 100755 (executable)
@@ -198,11 +198,14 @@ class CTRexGeneral_Test(unittest.TestCase):
     def check_for_trex_crash(self):
         pass
 
-    def get_benchmark_param (self, param, sub_param = None, test_name = None):
+    def get_benchmark_param (self, param, sub_param = None, test_name = None,default=None):
         if not test_name:
             test_name = self.get_name()
         if test_name not in self.benchmark:
-            self.skip('No data in benchmark.yaml for test: %s, param: %s. Skipping.' % (test_name, param))
+            if default ==None:
+               self.skip('No data in benchmark.yaml for test: %s, param: %s. Skipping.' % (test_name, param))
+            else:
+                return default
         if sub_param:
             return self.benchmark[test_name][param].get(sub_param)
         else: