diff options
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py')
-rwxr-xr-x | VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py index 5f78ec01..7ec270a1 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py @@ -43,6 +43,12 @@ class RapidTestManager(object): """ RapidTestManager Class """ + def __init__(self): + """ + Init Function + """ + self.machines = [] + def __del__(self): for machine in self.machines: machine.close_prox() @@ -53,18 +59,26 @@ class RapidTestManager(object): def run_tests(self, test_params): test_params = RapidConfigParser.parse_config(test_params) - RapidLog.debug(test_params) monitor_gen = monitor_sut = False background_machines = [] sut_machine = gen_machine = None - self.machines = [] configonly = test_params['configonly'] + machine_names = [] + machine_counter = {} for machine_params in test_params['machines']: + if machine_params['name'] not in machine_names: + machine_names.append(machine_params['name']) + machine_counter[machine_params['name']] = 1 + else: + machine_counter[machine_params['name']] += 1 + machine_params['name'] = '{}_{}'.format(machine_params['name'], + machine_counter[machine_params['name']]) if 'gencores' in machine_params.keys(): machine = RapidGeneratorMachine(test_params['key'], - test_params['user'], test_params['vim_type'], - test_params['rundir'], test_params['resultsdir'], - machine_params, configonly, test_params['ipv6']) + test_params['user'], test_params['password'], + test_params['vim_type'], test_params['rundir'], + test_params['resultsdir'], machine_params, configonly, + test_params['ipv6']) if machine_params['monitor']: if monitor_gen: RapidLog.exception("Can only monitor 1 generator") @@ -76,8 +90,9 @@ class RapidTestManager(object): background_machines.append(machine) else: machine = RapidMachine(test_params['key'], test_params['user'], - test_params['vim_type'], test_params['rundir'], - test_params['resultsdir'], machine_params, configonly) + test_params['password'], test_params['vim_type'], + test_params['rundir'], test_params['resultsdir'], + machine_params, configonly) if machine_params['monitor']: if monitor_sut: RapidLog.exception("Can only monitor 1 sut") @@ -87,6 +102,7 @@ class RapidTestManager(object): if machine_params['prox_socket']: sut_machine = machine self.machines.append(machine) + RapidLog.debug(test_params) try: prox_executor = concurrent.futures.ThreadPoolExecutor(max_workers=len(self.machines)) self.future_to_prox = {prox_executor.submit(machine.start_prox): machine for machine in self.machines} @@ -107,7 +123,8 @@ class RapidTestManager(object): test_params['TestName'], test_params['environment_file'], gen_machine, - sut_machine, background_machines) + sut_machine, background_machines, + test_params['sleep_time']) elif test_param['test'] in ['corestatstest']: test = CoreStatsTest(test_param, test_params['runtime'], @@ -166,7 +183,12 @@ def main(): test_params = RapidCli.process_cli(test_params) _, test_file_name = os.path.split(test_params['test_file']) _, environment_file_name = os.path.split(test_params['environment_file']) - log_file = 'RUN{}.{}.log'.format(environment_file_name, test_file_name) + if 'resultsdir' in test_params: + res_dir = test_params['resultsdir'] + log_file = '{}/RUN{}.{}.log'.format(res_dir,environment_file_name, + test_file_name) + else: + log_file = 'RUN{}.{}.log'.format(environment_file_name, test_file_name) RapidLog.log_init(log_file, test_params['loglevel'], test_params['screenloglevel'] , test_params['version'] ) test_manager = RapidTestManager() |