diff options
author | 2020-09-23 14:45:23 +0200 | |
---|---|---|
committer | 2020-09-29 10:15:14 +0200 | |
commit | 0d1b97e647224d3d977186523d45555bc819f42a (patch) | |
tree | 278e9ad8dbc3262dc07ea6b0a77defdc08cf7b4a /VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py | |
parent | 80dfeb5c734cc4d681f467e853a541a8a91fe1cf (diff) |
New PROX version, background traffic reporting
deploycentostools.sh is now installing a recent PROX version. When using
background traffic, the tool is also reporting the total traffic that
was handled by the NFVi stack, including foreground & background
traffic.
The use of the prox_socket and prox_launch_exit was also broken in a
previous release and is now fixed.
When setting prox_socket to false for a PROX instance, we will not
create a socket connection to control that PROX instance. Setting this
option to false is not meaningful for the generator PROX instances since
we would not be able to control the behavior of the PROX generator
during the test. You could use the generator against another non-PROX
instance and then set prox_socket to false for that non-PROX instance.
Default is true.
prox_launch_exit is used to start and stop the PROX program inside the
instance. Default is true. This is useful in case you want to start PROX
manually to be able to inspect the PROX UI, but at the same time, let
the rapid scripts control the testing.
Change-Id: Ib5aa809f4be201859542769f5f55f4989dad97ef
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py')
-rwxr-xr-x | VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py index 2c18b232..8e879a06 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py @@ -42,18 +42,21 @@ class RapidTestManager(object): """ RapidTestManager Class """ + def __del__(self): + for machine in self.machines: + machine.close_prox() + @staticmethod def get_defaults(): return (RapidDefaults.test_params) - @staticmethod - def run_tests(test_params): + 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 - machines = [] + self.machines = [] for machine_params in test_params['machines']: if 'gencores' in machine_params.keys(): machine = RapidGeneratorMachine(test_params['key'], @@ -79,14 +82,16 @@ class RapidTestManager(object): raise Exception("Can only monitor 1 sut") else: monitor_sut = True - sut_machine = machine - machines.append(machine) + if machine_params['prox_socket']: + sut_machine = machine + self.machines.append(machine) + prox_executor = concurrent.futures.ThreadPoolExecutor(max_workers=len(self.machines)) + self.future_to_prox = {prox_executor.submit(machine.start_prox,test_params['configonly']): machine for machine in self.machines} if test_params['configonly']: + concurrent.futures.wait(self.future_to_prox,return_when=ALL_COMPLETED) sys.exit() - prox_executor = concurrent.futures.ThreadPoolExecutor(max_workers=len(machines)) - future_to_prox = {prox_executor.submit(machine.start_prox): machine for machine in machines} - with concurrent.futures.ThreadPoolExecutor(max_workers=len(machines)) as executor: - future_to_connect_prox = {executor.submit(machine.connect_prox): machine for machine in machines} + with concurrent.futures.ThreadPoolExecutor(max_workers=len(self.machines)) as executor: + future_to_connect_prox = {executor.submit(machine.connect_prox): machine for machine in self.machines} concurrent.futures.wait(future_to_connect_prox,return_when=ALL_COMPLETED) result = True for test_param in test_params['tests']: @@ -101,11 +106,11 @@ class RapidTestManager(object): elif test_param['test'] in ['corestats']: test = CoreStatsTest(test_param, test_params['runtime'], test_params['TestName'], - test_params['environment_file'], machines) + test_params['environment_file'], self.machines) elif test_param['test'] in ['portstats']: test = PortStatsTest(test_param, test_params['runtime'], test_params['TestName'], - test_params['environment_file'], machines) + test_params['environment_file'], self.machines) elif test_param['test'] in ['impairtest']: test = ImpairTest(test_param, test_params['lat_percentile'], test_params['runtime'], @@ -115,7 +120,7 @@ class RapidTestManager(object): elif test_param['test'] in ['irqtest']: test = IrqTest(test_param, test_params['runtime'], test_params['TestName'], - test_params['environment_file'], machines) + test_params['environment_file'], self.machines) elif test_param['test'] in ['warmuptest']: test = WarmupTest(test_param, gen_machine) else: @@ -124,8 +129,6 @@ class RapidTestManager(object): single_test_result = test.run() if not single_test_result: result = False - for machine in machines: - machine.close_prox() return (result) def main(): @@ -139,7 +142,8 @@ def main(): test_params['test_file']) RapidLog.log_init(log_file, test_params['loglevel'], test_params['screenloglevel'] , test_params['version'] ) - test_result = RapidTestManager.run_tests(test_params) + test_manager = RapidTestManager() + test_result = test_manager.run_tests(test_params) RapidLog.info('Test result is : {}'.format(test_result)) if __name__ == "__main__": |