fix regex expression to find IPV4 address
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / rapid_parser.py
index 81a1c45..ee8fa67 100644 (file)
@@ -46,6 +46,12 @@ class RapidConfigParser(object):
             test_params['lat_percentile'] = 0.99
         RapidLog.info('Latency percentile at {:.0f}%'.format(
             test_params['lat_percentile']*100))
+        if testconfig.has_option('TestParameters', 'sleep_time'):
+            test_params['sleep_time'] = int(testconfig.get('TestParameters', 'sleep_time'))
+            if test_params['sleep_time'] < 2:
+                test_params['sleep_time'] = 2
+        else:
+            test_params['sleep_time'] = 2
 
         if testconfig.has_option('TestParameters', 'ipv6'):
             test_params['ipv6'] = testconfig.getboolean('TestParameters','ipv6')
@@ -85,7 +91,7 @@ class RapidConfigParser(object):
                         'flowsize','warmupflowsize','warmuptime', 'steps']:
                     test[option] = int(testconfig.get(section, option))
                 elif option in ['startspeed', 'step', 'drop_rate_threshold',
-                        'lat_avg_threshold','lat_perc_threshold',
+                        'generator_threshold','lat_avg_threshold','lat_perc_threshold',
                         'lat_max_threshold','accuracy','maxr','maxz',
                         'ramp_step','warmupspeed','mis_ordered_threshold']:
                     test[option] = float(testconfig.get(section, option))
@@ -93,11 +99,12 @@ class RapidConfigParser(object):
                     test[option] = testconfig.get(section, option)
             tests.append(dict(test))
         for test in tests:
-            if test['test'] in ['flowsizetest','TST009test']:
+            if test['test'] in ['flowsizetest', 'TST009test', 'increment_till_fail']:
                 if 'drop_rate_threshold' not in test.keys():
                     test['drop_rate_threshold'] = 0
-                latency_thresholds = ['lat_avg_threshold','lat_perc_threshold','lat_max_threshold','mis_ordered_threshold']
-                for threshold in latency_thresholds:
+                thresholds = ['generator_threshold','lat_avg_threshold', \
+                        'lat_perc_threshold','lat_max_threshold','mis_ordered_threshold']
+                for threshold in thresholds:
                     if threshold not in test.keys():
                         test[threshold] = inf
         test_params['tests'] = tests