summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py74
1 files changed, 56 insertions, 18 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
index e5ed10d0..143323b8 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
@@ -46,6 +46,13 @@ 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')
else:
@@ -53,8 +60,15 @@ class RapidConfigParser(object):
config = configparser.RawConfigParser()
config.read(test_params['environment_file'])
test_params['vim_type'] = config.get('Varia', 'vim')
- test_params['key'] = config.get('ssh', 'key')
test_params['user'] = config.get('ssh', 'user')
+ if config.has_option('ssh', 'key'):
+ test_params['key'] = config.get('ssh', 'key')
+ else:
+ test_params['key'] = None
+ if config.has_option('ssh', 'password'):
+ test_params['password'] = config.get('ssh', 'password')
+ else:
+ test_params['password'] = None
test_params['total_number_of_machines'] = int(config.get('rapid',
'total_number_of_machines'))
tests = []
@@ -64,26 +78,27 @@ class RapidConfigParser(object):
section = 'test%d'%test_index
options = testconfig.options(section)
for option in options:
- if option in ['imix','imixs','flows']:
+ if option in ['imix','imixs','flows', 'warmupimix']:
test[option] = ast.literal_eval(testconfig.get(section,
option))
elif option in ['maxframespersecondallingress','stepsize',
- 'flowsize']:
+ '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']:
+ 'ramp_step','warmupspeed','mis_ordered_threshold']:
test[option] = float(testconfig.get(section, option))
else:
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']
- 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
@@ -91,24 +106,46 @@ class RapidConfigParser(object):
'total_number_of_machines']:
RapidLog.exception("Not enough VMs for this test: %d needed and only %d available" % (required_number_of_test_machines,total_number_of_machines))
raise Exception("Not enough VMs for this test: %d needed and only %d available" % (required_number_of_test_machines,total_number_of_machines))
+ map_info = test_params['machine_map_file'].strip('[]').split(',')
+ map_info_length = len(map_info)
+ # If map_info is a list where the first entry is numeric, we assume we
+ # are dealing with a list of machines and NOT the machine.map file
+ if map_info[0].isnumeric():
+ if map_info_length < test_params[
+ 'required_number_of_test_machines']:
+ RapidLog.exception('Not enough machine indices in --map \
+ parameter: {}. Needing {} entries'.format(map_info,
+ test_params['required_number_of_test_machines']))
+ machine_index = list(map(int,map_info))
+ else:
+ machine_map = configparser.RawConfigParser()
+ machine_map.read(test_params['machine_map_file'])
+ machine_index = []
+ for test_machine in range(1,
+ test_params['required_number_of_test_machines']+1):
+ machine_index.append(int(machine_map.get(
+ 'TestM%d'%test_machine, 'machine_index')))
machine_map = configparser.RawConfigParser()
machine_map.read(test_params['machine_map_file'])
machines = []
machine = {}
- for test_machine in range(1, test_params['required_number_of_test_machines']+1):
+ for test_machine in range(1, test_params[
+ 'required_number_of_test_machines']+1):
machine.clear()
section = 'TestM%d'%test_machine
options = testconfig.options(section)
for option in options:
if option in ['prox_socket','prox_launch_exit','monitor']:
machine[option] = testconfig.getboolean(section, option)
- elif option in ['cores', 'gencores','latcores']:
+ elif option in ['mcore', 'cores', 'gencores', 'latcores',
+ 'altcores']:
machine[option] = ast.literal_eval(testconfig.get(
section, option))
elif option in ['bucket_size_exp']:
machine[option] = int(testconfig.get(section, option))
if machine[option] < 11:
- RapidLog.exception("Minimum Value for bucket_size_exp is 11")
+ RapidLog.exception(
+ "Minimum Value for bucket_size_exp is 11")
else:
machine[option] = testconfig.get(section, option)
for key in ['prox_socket','prox_launch_exit']:
@@ -116,9 +153,7 @@ class RapidConfigParser(object):
machine[key] = True
if 'monitor' not in machine.keys():
machine['monitor'] = True
- index = int(machine_map.get('TestM%d'%test_machine,
- 'machine_index'))
- section = 'M%d'%index
+ section = 'M%d'%machine_index[test_machine-1]
options = config.options(section)
for option in options:
machine[option] = config.get(section, option)
@@ -130,10 +165,13 @@ class RapidConfigParser(object):
while True:
dp_ip_key = 'dp_ip{}'.format(index)
dp_mac_key = 'dp_mac{}'.format(index)
- if dp_ip_key in machines[int(machine['dest_vm'])-1].keys() and \
- dp_mac_key in machines[int(machine['dest_vm'])-1].keys():
- dp_port = {'ip': machines[int(machine['dest_vm'])-1][dp_ip_key],
- 'mac' : machines[int(machine['dest_vm'])-1][dp_mac_key]}
+ if dp_ip_key in machines[int(machine['dest_vm'])-1].keys():
+ if dp_mac_key in machines[int(machine['dest_vm'])-1].keys():
+ dp_port = {'ip': machines[int(machine['dest_vm'])-1][dp_ip_key],
+ 'mac' : machines[int(machine['dest_vm'])-1][dp_mac_key]}
+ else:
+ dp_port = {'ip': machines[int(machine['dest_vm'])-1][dp_ip_key],
+ 'mac' : None}
dp_ports.append(dict(dp_port))
index += 1
else: