diff options
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py')
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py index 074d4f7e..e52b17db 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py @@ -17,7 +17,6 @@ ## from rapid_log import RapidLog -from prox_ctrl import prox_ctrl from rapid_machine import RapidMachine from math import ceil, log2 @@ -49,8 +48,8 @@ class RapidGeneratorMachine(RapidMachine): """ Class to deal with a generator PROX instance (VM, bare metal, container) """ - def __init__(self, key, user, vim, rundir, resultsdir, machine_params, - configonly, ipv6): + def __init__(self, key, user, password, vim, rundir, resultsdir, + machine_params, configonly, ipv6): mac_address_size = 6 ethertype_size = 2 FCS_size = 4 @@ -74,8 +73,12 @@ class RapidGeneratorMachine(RapidMachine): self.udp_dest_port_offset = udp_header_start_offset + 2 self.udp_length_offset = udp_header_start_offset + 4 self.ipv6 = ipv6 - super().__init__(key, user, vim, rundir, resultsdir, machine_params, - configonly) + if 'bucket_size_exp' in machine_params.keys(): + self.bucket_size_exp = machine_params['bucket_size_exp'] + else: + self.bucket_size_exp = 11 + super().__init__(key, user, password, vim, rundir, resultsdir, + machine_params, configonly) def get_cores(self): return (self.machine_params['gencores'] + @@ -99,21 +102,11 @@ class RapidGeneratorMachine(RapidMachine): RapidLog.debug('{} ({}): latcores {} remapped to {}'.format(self.name, self.ip, self.machine_params['latcores'], cpus_remapped)) self.machine_params['latcores'] = cpus_remapped - def generate_lua(self, vim, prox_config_file): + def generate_lua(self): appendix = 'gencores="%s"\n'% ','.join(map(str, self.machine_params['gencores'])) appendix = appendix + 'latcores="%s"\n'% ','.join(map(str, self.machine_params['latcores'])) - if 'gw_vm' in self.machine_params.keys(): - for index, gw_ip in enumerate(self.machine_params['gw_ips'], - start = 1): - appendix = appendix + 'gw_ip{}="{}"\n'.format(index, gw_ip) - appendix = (appendix + 'gw_hex_ip{}=convertIPToHex(gw_ip{})\n'. - format(index, index)) - if 'bucket_size_exp' in self.machine_params.keys(): - self.bucket_size_exp = self.machine_params['bucket_size_exp'] - else: - self.bucket_size_exp = 11 appendix = (appendix + 'bucket_size_exp="{}"\n'.format(self.bucket_size_exp)) if 'heartbeat' in self.machine_params.keys(): @@ -121,14 +114,12 @@ class RapidGeneratorMachine(RapidMachine): 'heartbeat="%s"\n'% self.machine_params['heartbeat']) else: appendix = appendix + 'heartbeat="60"\n' - super().generate_lua(vim, prox_config_file, appendix) + super().generate_lua(appendix) def start_prox(self): # Start the generator with the -e option so that the cores don't # start automatically super().start_prox('-e') - if self.vim in ['kubernetes']: - self.remap_all_cpus() def set_generator_speed(self, speed): # The assumption is that we only use task 0 for generating |