stress_test package¶
Submodules¶
stress_test.controller module¶
-
class
stress_test.controller.Controller(ctrl_base_dir, test_config)[source]¶ Bases:
objectAll controller-related functionality is here
-
build()[source]¶ Wrapper to the controller build handler
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlBuildError – if build process fails
-
check_other_controller()[source]¶ Checks for processes listening on the specified port
Raises: controller_exceptions.CtrlPortConflictError – when another process listens on controller’s port.
-
check_status()[source]¶ Wrapper to the controller status handler
Returns: the status of the controller (running = 1, not running = 0)
Return type: int
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlStatusUnknownError – if the handler fails to return controller status or fails to execute
-
cleanup()[source]¶ Wrapper to the controller cleanup handler
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlCleanupError – if controller cleanup handler fails
-
getcontroller()[source]¶ Wrapper to the get controller handler
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlGetError – if get controller process fails
-
init_ssh()[source]¶ Initializes a new SSH client object, with the controller node and assigns it to the protected attribute _ssh_conn. If a connection already exists it returns a new SSH client object to the controller node.
Raises: controller_exceptions.CtrlNodeConnectionError – if ssh connection establishment fails
-
static
new(ctrl_base_dir, test_config)[source]¶ Factory method. Creates a subclass class depending on the controller name
Returns: a subclass or None Return type: object Raises: NotImplementedError – in case an invalid controller_name is given in the configuration json file
-
start()[source]¶ Wrapper to the controller start handler
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlStartError – When controller fails to start.
-
stop()[source]¶ Wrapper to the controller stop handler
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.CtrlStopError – if controller fails to stop successfully
-
wait_until_listens(timeout_ms)[source]¶ Waits for controller to start listening on specified port.
Parameters: timeout_ms (int) – milliseconds to wait (in milliseconds).
Returns: the process ID PID of the controller.
Return type: int
Raises: - controller_exceptions.CtrlReadyStateError – If controller fails to start
- controller_exceptions.CtrlPortConflictError – if another process listens on controllers port.
-
-
class
stress_test.controller.ODL(ctrl_base_dir, test_config)[source]¶ Bases:
stress_test.controller.ControllerAll OpenDaylight controller-related functionality is here
-
change_stats()[source]¶ Wrapper to the controller statistics handler. Changes the value of statistics interval in the configuration files of controller.
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.ODLChangeStats – if change of statistics interval fails
-
disable_persistence()[source]¶ Configure controller persistent to false in order not to backup datastore on the disk.
Raises: controller_exceptions.ODLDisablePersistenceError – if disable of persistence fails
-
flowmods_config()[source]¶ Configure controller to send flow modifications as a response to ARP ARP Packet_INs.
Raises: controller_exceptions.ODLFlowModConfError – if configuration actions to respond with flow modifications fail.
-
generate_xmls()[source]¶ Starts and then stops the controller to trigger the generation of controller’s XML files.
Raises: controller_exceptions.ODLXMLError – if generation of XML files fails
-
get_oper_flows(new_ssh_conn=None)[source]¶ Wrapper to the controller oper_flows handler. Makes a REST call to the NB interface of the controller and returns the number of flows of the topology, recorded in operational datastore of the controller
Parameters: new_ssh_conn (paramiko.SSHClient) – an ssh connection client object
Returns: number of flows from controller’s operational datastore
Return type: int
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.ODLGetOperFlowsError – if handler fails to run or return a valid value
-
get_oper_hosts(new_ssh_conn=None)[source]¶ Wrapper to the controller oper_hosts handler. Makes a REST call to the NB interface of the controller and returns the number of hosts of the topology, recorded in operational datastore of the controller
Parameters: new_ssh_conn (paramiko.SSHClient) – an ssh connection client object
Returns: number of hosts from controller’s operational datastore
Return type: int
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.ODLGetOperHostsError – if handler fails to run or return a valid value
-
get_oper_links(new_ssh_conn=None)[source]¶ Wrapper to the controller oper_links handler. Makes a REST call to the NB interface of the controller and returns the number of links of the topology, recorded in operational datastore of the controller
Parameters: new_ssh_conn (paramiko.SSHClient) – an ssh connection client object
Returns: number of links from controller’s operational datastore
Return type: int
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.ODLGetOperLinksError – if handler fails to run or return a valid value
-
get_oper_switches(new_ssh_conn=None)[source]¶ Wrapper to the controller oper_switches handler. Makes a REST call to the NB interface of the controller and returns the number of switches of the topology, recorded in operational datastore of the controller
Parameters: new_ssh_conn (paramiko.SSHClient) – an ssh connection client object
Returns: number of switches from controller’s operational datastore
Return type: int
Raises: - IOError – if the handler does not exist on the remote host
- controller_exceptions.ODLGetOperSwitchesError – if handler fails to run or return a valid value
-
-
class
stress_test.controller.ONOS(ctrl_base_dir, test_config)[source]¶ Bases:
stress_test.controller.ControllerAll ONOS controller-related functionality is here
stress_test.controller_exceptions module¶
Implementation of custom controller exception classes.
-
exception
stress_test.controller_exceptions.CtrlBuildError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller building functionality.
-
exception
stress_test.controller_exceptions.CtrlCleanupError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller cleaning functionality.
-
exception
stress_test.controller_exceptions.CtrlError(err_msg=None, err_code=1)[source]¶ Bases:
ExceptionContains the exception handling concerning the Controller class functionalities.
-
exception
stress_test.controller_exceptions.CtrlGetError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller Get functionality.
-
exception
stress_test.controller_exceptions.CtrlNodeConnectionError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller connectivity.
-
exception
stress_test.controller_exceptions.CtrlPortConflictError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning errors in the Southbound port of the controller
-
exception
stress_test.controller_exceptions.CtrlReadyStateError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the controller readyness
-
exception
stress_test.controller_exceptions.CtrlStartError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller starting functionality.
-
exception
stress_test.controller_exceptions.CtrlStatusUnknownError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling unknown errors on the Controller
-
exception
stress_test.controller_exceptions.CtrlStopError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Controller stopping functionality.
-
exception
stress_test.controller_exceptions.ODLChangeStats(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Opendaylight Controller changing statistics period functionality
-
exception
stress_test.controller_exceptions.ODLDisablePersistenceError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Opendaylight Controller changing persistence functionality
-
exception
stress_test.controller_exceptions.ODLFlowModConfError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Opendaylight Controller flow modification functionality
-
exception
stress_test.controller_exceptions.ODLGetOperFlowsError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the returned flows from Opendaylight Controller datastore
-
exception
stress_test.controller_exceptions.ODLGetOperHostsError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the returned hosts from Opendaylight Controller datastore
-
exception
stress_test.controller_exceptions.ODLGetOperLinksError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the returned links from Opendaylight Controller datastore
-
exception
stress_test.controller_exceptions.ODLGetOperSwitchesError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the returned switches from Opendaylight Controller datastore
-
exception
stress_test.controller_exceptions.ODLXMLError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.controller_exceptions.CtrlErrorContains the exception handling concerning the Opendaylight Controller XML generation
stress_test.html_generation module¶
HTML generation functions
-
stress_test.html_generation.generate_html(report_spec, report_filename)[source]¶ Generates the test HTML report
Parameters: - report_spec (ReportSpec) – report specification for this report
- report_filename (str) – target HTML filename
-
stress_test.html_generation.generate_table(tables_specs)[source]¶ Gets a dictionary with tables specifications and generates the corresponded html code.
Parameters: tables_specs (<dictionary>) – Dictionary containing the specifications of a group of tables. Returns: html code of the table. Return type: str
-
stress_test.html_generation.insert_plots(plots_list)[source]¶ Gets a list of dictionaries that describes the plots of the report, and generates the corresponded html code.
Parameters: plots_list (<list<dictionary>>) – A list of dictionaries with the plots description. Returns: The corresponded html code to insert the plots. Return type: str
stress_test.monitor module¶
Monitor Class- All monitoring-related functionality is here
-
class
stress_test.monitor.Monitor(controller)[source]¶ Bases:
objectAll monitor- related functionality is here
-
class
stress_test.monitor.Mtcbench(controller, emulator)[source]¶ Bases:
stress_test.monitor.MonitorMTCbench- related monitoring. Subclass of Monitor superclass
-
monitor_results_active()[source]¶ This monitor function is used from south bound active mtcbench tests to collect the related key results
Returns: Returns the dictionary with the results included into JSON input file Return type: dict
-
monitor_results_idle()[source]¶ This monitor function is used from south bound idle mtcbench tests to collect the related key results
Returns: Returns the dictionary with the results included into JSON input file Return type: dict
-
monitor_run(boot_start_time=None)[source]¶ This monitor function is used from both south bound active and idle mtcbench tests to get the results from gevent queue
Parameters: boot_start_time (int) – The time we begin starting topology switches Returns: Returns a dictionary, including all the results Return type: dict
-
monitor_thread_active()[source]¶ This monitor function is used from south bound active mtcbench tests to put into gevent queue the results during test running
-
monitor_thread_idle(boot_start_time)[source]¶ This monitor function is used from south bound idle mtcbench tests to put into gevent queue the results during test running
Parameters: boot_start_time (int) – The time we begin starting topology switches
-
mtcbench_thread(block_flag=True, data_queue=None)[source]¶ Function used to execute MTCBench thread
Parameters: - block_flag (boolean) – It is used as a flag. When it is True the emulator run will wait for the completition of MTcbench thread running
- data_queue (queue) – If not None the results are written into the data_queue line by line. In case of None the results are written into standard output
Returns: Returns a dictionary, including all the results
Return type: dict
-
-
class
stress_test.monitor.Multinet(controller, oftraf, emulator)[source]¶ Bases:
stress_test.monitor.MonitorMultinet- related monitoring. Subclass of Monitor superclass
-
monitor_run(reference_results=None, sample_id=None, boot_start_time=None)[source]¶ This monitor function is used from both south bound active and idle multinet tests to get the results from gevent queue
Parameters: - reference_results (dict) – The results returned from the just previous iteration of the test. Used in the frame of a stability test
- sample_id (int) – The id of the sample running. Used in the frame of a stability test
- boot_start_time (int) – The time we begin starting topology switches
Returns: Returns a dictionary, including all the results
Return type: dict
-
monitor_thread_active()[source]¶ This monitor function is used from active scalability multinet tests to put the results into gevent queue
-
monitor_thread_idle_scalability(boot_start_time)[source]¶ This monitor function is used from both idle scalability multinet tests tests to put into gevent queue the results during test running
Parameters: boot_start_time (int) – The time we begin starting topology switches
-
monitor_thread_idle_stability(reference_results, sample_id)[source]¶ This monitor function is used from idle stability multinet tests to put the results into gevent queue
Parameters: - reference_results (dict) – The results returned from the just previous iteration of the test. Used in the frame of a stability test
- sample_id (int) – The id of the sample running. Used in the frame of a stability test
-
-
class
stress_test.monitor.NBgen(controller, nbgen, sbemu)[source]¶ Bases:
stress_test.monitor.MonitorNB-generator- related monitoring. Subclass of Monitor superclass
-
monitor_results_add(add_controller_time, results_thread, total_failed_flows)[source]¶ This monitor function is used to create the result dictionary during an add flows action
Parameters: - add_controller_time (float) – time for all add REST requests to be sent and their response to be received
- results_thread (dict) – The dictionary from monitor_threads_run function including the contents from nbgen_queue
- total_failed_flows (int) – The number of failed flows after an add or delete function
Returns: Returns a dictionary, including all the results
Return type: dict
-
monitor_results_del(controller_time, results_thread, total_failed_flows)[source]¶ This monitor function is used to create the result dictionary during a delete flows action
Parameters: - controller_time (float) – time for all delete REST requests to be sent and their response to be received
- results_thread (dict) – The dictionary from monitor_threads_run function including the contents from nbgen_queue
- total_failed_flows (int) – The number of failed flows after an add or delete function
Returns: Returns a dictionary, including all the results
Return type: dict
-
monitor_threads_run(t_start, total_failed_flows, expected_flows, flow_delete_flag)[source]¶ This monitor function is used from north bound tests to get the results from gevent queue
Parameters: - t_start (float) – timestamp for beginning of discovery iteration of the test.
- total_failed_flows (int) – The number of failed flows after an add or delete function
- expected_flows (int) – The number of expected flows to be compared with discovered flows
- flow_delete_flag (boolean) – Flag, which when is set to True, a delete flows action in DS is performed. Otherwise an add flows action is performed
Returns: Returns a dictionary, including all the results
Return type: dict
-
stress_test.nbemu module¶
NB-Generator Class- All NB-Generator-related functionality is here
-
class
stress_test.nbemu.NBgen(nb_gen_base_dir, test_config, controller, sbemu, log_level='DEBUG')[source]¶ Bases:
objectNorthBound emulator class
-
build()[source]¶ Wrapper to the NB-Generator build handler
Raises: - IOError – if the handler does not exist on the remote host
- nb_emulator_exceptions.NBGenBuildError – if build process fails
-
clean()[source]¶ Wrapper to the NB-Generator clean handler
Raises: - IOError – if the handler does not exist on the remote host
- nb_emulator_exceptions.NBGenCleanError – if clean process fails
-
init_ssh()[source]¶ Initializes a new SSH client object, with the nb_emulator node and assigns it to the protected attribute _ssh_conn. If a connection already exists it returns a new SSH client object to the controller node.
Raises: nb_emulator_exceptions.NBGenNodeConnectionError – if ssh connection establishment fails
-
stress_test.nbemu_exceptions module¶
Implementation of custom NB generator exception classes.
-
exception
stress_test.nbemu_exceptions.NBGenBuildError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.nbemu_exceptions.NBGenErrorContains the exception handling concerning the North-Bound Emulator building functionality.
-
exception
stress_test.nbemu_exceptions.NBGenCleanError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.nbemu_exceptions.NBGenErrorContains the exception handling concerning the North-Bound Emulator cleaning functionality.
-
exception
stress_test.nbemu_exceptions.NBGenError(err_msg=None, err_code=1)[source]¶ Bases:
ExceptionContains the exception handling concerning the North-Bound Emulator class functionalities.
-
exception
stress_test.nbemu_exceptions.NBGenNodeConnectionError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.nbemu_exceptions.NBGenErrorContains the exception handling concerning the North-Bound Emulator class connectivity.
-
exception
stress_test.nbemu_exceptions.NBGenRunError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.nbemu_exceptions.NBGenErrorContains the exception handling concerning the North-Bound Emulator cleaning functionality.
stress_test.nstat_orchestrator module¶
stress_test.oftraf module¶
Oftraf Class- All oftraf monitor-related functionality is here. Note that Oftraf Monitor runs thereto the controller is located (Controller-SB interface)
-
class
stress_test.oftraf.Oftraf(controller, test_config)[source]¶ Bases:
objectAll Oftraf related functionality is here
-
build()[source]¶ Wrapper to the oftraf monitor build handler
Raises: - IOError – if the handler does not exist on the remote host
- oftraf_exceptions.OftrafBuildError – if build process fails
-
clean()[source]¶ Wrapper to the oftraf monitor clean handler
Raises: - IOError – if the handler does not exist on the remote host
- oftraf_exceptions.OftrafCleanError – if clean process fails
-
get_oftraf_path()[source]¶ Returns oftraf base directory path, using as base to the project path
Returns: oftraf folder path Return type: str
-
oftraf_get_of_counts()[source]¶ Gets the openFlow packets counts, measured by oftraf. It uses the oftraf REST interface and returns the result as a string in JSON format
Returns: oftraf metrics as string in JSON format Return type: str Raises: oftraf_exceptions.OftrafError – if execution of handler fails
-
stress_test.oftraf_exceptions module¶
Implementation of custom oftraf exception classes.
-
exception
stress_test.oftraf_exceptions.OftrafBuildError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.oftraf_exceptions.OftrafErrorContains the exception handling concerning the Oftraf building functionality.
-
exception
stress_test.oftraf_exceptions.OftrafCleanError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.oftraf_exceptions.OftrafErrorContains the exception handling concerning the Oftraf measurements (packet counts) functionality.
-
exception
stress_test.oftraf_exceptions.OftrafError(err_msg=None, err_code=1)[source]¶ Bases:
ExceptionContains the exception handling concerning the Oftraf class functionalities.
-
exception
stress_test.oftraf_exceptions.OftrafGetResultError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.oftraf_exceptions.OftrafErrorContains the exception handling concerning the Oftraf cleaning functionality.
-
exception
stress_test.oftraf_exceptions.OftrafStartError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.oftraf_exceptions.OftrafErrorContains the exception handling concerning the Oftraf starting functionality.
-
exception
stress_test.oftraf_exceptions.OftrafStopError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.oftraf_exceptions.OftrafErrorContains the exception handling concerning the Oftraf stopping functionality.
stress_test.report_gen module¶
-
class
stress_test.report_gen.ReportGen(args, test_config_json, report_spec, total_samples)[source]¶ Bases:
objectClass used for Reporting and plot generation after a test
-
generate_html_report()[source]¶ NSTAT save log file
Parameters: - args (ArgumentParser object) – argparse.ArgumentParser object containing user specified parameters (i.e test type, controller base directory, generator directory) when running NSTAT
- report_spec (ReportSpec object) – A ReportSpec object that holds all the test report information and is passed as input to the generate_html() function in the html_generation.py, that is responsible for the report generation.
-
generate_json_results()[source]¶ Creates the result json file and writes test results in it
Parameters: - results (list) – A list containing the results.
- out_json (str) – The file path of json file to be created and write results in it
-
generate_plots()[source]¶ NSTAT post test actions
Parameters: - args (object) – Object containing user specified parameters (i.e test type, controller base directory, generator base directory) when running NSTAT
- test_config (object) – JSON input configuration
- report_spec (object) – A ReportSpec object that holds all the test report information and is passed as input to the generate_html() function in the html_generation.py, that is responsible for the report generation.
-
stress_test.report_spec module¶
stress_test.report_spec_templates module¶
-
class
stress_test.report_spec_templates.TestReport(test_type, config_json_file)[source]¶ Bases:
objectCreates a class for each test includeing the key to be demonstrated
-
nb_active_scalability_multinet(results_json_file)[source]¶ Returns the report specification object for NorthBound active scalability test with Multinet
Parameters: results_json_file – JSON results path Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_active_scalability_mtcbench(results_json_file)[source]¶ Returns the report specification for the Southbound active scalability test with MT-Cbench
Parameters: results_json_file – This is the filepath to the results json file Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_active_scalability_multinet(results_json_file)[source]¶ Returns the report specification object for SouthBound active scalability test with Multinet
Parameters: results_json_file – This is the filepath to the results json file. Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_active_stability_mtcbench(results_json_file)[source]¶ Returns the report specification object for SouthBound active stabiility test with MT-Cbench.
Parameters: results_json_file – This is the filepath to the results json file. Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_idle_scalability_mtcbench(results_json_file)[source]¶ Returns the report specification object for SouthBound idle scalability test with MT-Cbench
Parameters: results_json_file – JSON results path Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_idle_scalability_multinet(results_json_file)[source]¶ Returns the report specification object for SouthBound idle scalability test with Multinet
Parameters: results_json_file – JSON results path Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
sb_idle_stability_multinet(results_json_file)[source]¶ Returns the report specification object for SouthBound idle stability test with Multinet
Parameters: results_json_file – JSON results path Returns: report specification object Return type: ReportSpec Type: results_json_file: str
-
stress_test.sbemu module¶
SB-Emulator Class- All SB-Emulator-related functionality is here
-
class
stress_test.sbemu.MTCBench(sb_emu_base_dir, test_config)[source]¶ Bases:
stress_test.sbemu.SBEmuAll South-bound MTCbench related functionality is here
-
get_overall_topo_size()[source]¶ Calculates and returns the total topology size.
Returns: the total switch number Return type: int
-
get_topo_bootup_ms()[source]¶ Calculates and returns the total topology bootup time in ms.
Returns: the total time for the topology to bootup Return type: int
-
run(ctrl_ip, ctrl_sb_port, prefix='[MTCBench.run_handler]', lines_queue=None, print_flag=True, block_flag=True, getpty_flag=False)[source]¶ Wrapper to the MTCBench SB-Emulator run handler
Parameters: - ctrl_ip (str) – The ip address of the controller
- ctrl_sb_port (int) – the port number of the SouthBound interface of the controller
- prefix (str) – prefix of logging messages printed during execution of MTCbench handler
- lines_queue (gevent.queue.Queue()) – a queue object gathering the output of MTCbench handler line by line.
- print_flag (bool) – defines if the output of MTCbench handler will be printed on the screen
- block_flag (bool) – defines if the run handler will run in blocking or non blocking mode. In not blocking mode no output will be printed or saved in a queue.
- getpty_flag (bool) – defines if the run handler will run in a separate pty terminal
Raises: - IOError – if the exit status of the handler is not 0
- emulator_exceptions.MTCbenchRunError – in case of run MTCbench error
-
-
class
stress_test.sbemu.Multinet(sb_emu_base_dir, test_config)[source]¶ Bases:
stress_test.sbemu.SBEmuAll South-bound Multinet related functionality is here
-
cleanup()[source]¶ Wrapper to the Multinet SB-Emulator cleanup handler
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetCleanupError – if Multinet cleanup handler fails
-
deploy(cntrl_ip, cntrl_of_port)[source]¶ Wrapper to the Multinet SB-Emulator deploy handler
Parameters: - cntrl_ip (str) – The IP of the Controller.
- cntrl_of_port (int) – The openflow interface port of the Controller
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetDeployError – in case of Multinet deploy error
-
generate_traffic()[source]¶ Wrapper to the Multinet SB-Emulator traffic_gen handler
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetTraffigGenError – if Multinet traffic generator handler fails to run successfully
-
get_flows(new_ssh_conn=None)[source]¶ Wrapper to the Multinet SB-Emulator get_flows handler
Parameters: new_ssh_conn (paramiko.SFTPClient) – an SSH client connection object
Returns: The per worker total number of flows in json string
Return type: str
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetGetFlowsError – if handler fails to run successfully
-
get_overall_topo_size()[source]¶ Calculates and returns the total topology size.
Returns: the total worker number Return type: int
-
get_switches(new_ssh_conn=None)[source]¶ Wrapper to the Multinet SB-Emulator get_switches handler
Parameters: new_ssh_conn (paramiko.SFTPClient) – an SSH client connection object
Returns: The per worker number of switches in json string
Return type: strcleanup_hnd
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetGetSwitchesError – if handler fails to run successfully and return a valid result
-
get_topo_bootup_ms()[source]¶ Calculates and returns the total topology bootup time in ms.
Returns: the total time for the topology to bootup Return type: int
-
init_topos()[source]¶ Wrapper to the Multinet SB-Emulator init_topos handler
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.MultinetInitToposError – if Multinet initialization fails
-
-
class
stress_test.sbemu.SBEmu(sb_emu_base_dir, test_config)[source]¶ Bases:
objectSouthbound emulator super class
-
build()[source]¶ Wrapper to the SB-Emulator build handler
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.SBEmuBuildError – build fails
-
clean()[source]¶ Wrapper to the SB-Emulator clean handler
Raises: - IOError – if the handler does not exist on the remote host
- emulator_exceptions.SBEmuCleanupError – if cleanup process fails
-
init_ssh()[source]¶ Initializes a new SSH client object, with the emulator node and assigns it to the protected attribute _ssh_conn. If a connection already exists it returns a new SSH client object to the controller node.
Raises: emulator_exceptions.SBEmuNodeConnectionError – if ssh connection establishment fails
-
static
new(sb_emu_base_dir, test_config)[source]¶ Factory method. Creates a subclass class depending on the SB-Emulator name
Parameters: - test_config (JSON configuration dictionary) – JSON input configuration
- sb_emu_base_dir (str) – emulator base directory
Returns: a subclass or None
Return type: object
Raises: NotImplementedError – in case an invalid sb_emulator_name is given in the json configuration file
-
stress_test.sbemu_exceptions module¶
Implementation of custom SB emulator exception classes.
-
exception
stress_test.sbemu_exceptions.MTCbenchRunError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Emulator running functionality.
-
exception
stress_test.sbemu_exceptions.MultinetCleanupError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Multinet Emulator cleaning functionality.
-
exception
stress_test.sbemu_exceptions.MultinetConfGenerateError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Emulator building functionality.
-
exception
stress_test.sbemu_exceptions.MultinetDeployError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Multinet Emulator deploy.
-
exception
stress_test.sbemu_exceptions.MultinetGetFlowsError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the returned flows from a the South-Bound Emulator topology
-
exception
stress_test.sbemu_exceptions.MultinetGetSwitchesError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the returned switches from a the South-Bound Emulator topology
-
exception
stress_test.sbemu_exceptions.MultinetInitToposError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the initialization of a South-Bound Multinet topology
-
exception
stress_test.sbemu_exceptions.MultinetOutputParsingError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the console output from the South-Bound Multinet Emulator.
-
exception
stress_test.sbemu_exceptions.MultinetStartToposError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the staring of a South-Bound Multinet topology
-
exception
stress_test.sbemu_exceptions.MultinetStopToposError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the stopping of a South-Bound Multinet topology
-
exception
stress_test.sbemu_exceptions.MultinetTraffigGenError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Multinet Emulator traffic generator functionality.
-
exception
stress_test.sbemu_exceptions.SBEmuBuildError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Emulator building functionality.
-
exception
stress_test.sbemu_exceptions.SBEmuCleanupError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Emulator cleaning functionality.
-
exception
stress_test.sbemu_exceptions.SBEmuError(err_msg=None, err_code=1)[source]¶ Bases:
ExceptionContains the exception handling concerning the South-Bound Emulator class functionalities.
-
exception
stress_test.sbemu_exceptions.SBEmuNodeConnectionError(additional_error_info='', err_code=1)[source]¶ Bases:
stress_test.sbemu_exceptions.SBEmuErrorContains the exception handling concerning the South-Bound Emulator class connectivity.
stress_test.test_run module¶
Test run class. Here we define the different type of test run methods for each test
-
class
stress_test.test_run.TestRun(args, json_conf, test_type)[source]¶ Bases:
objectCreates a Test run object
-
nb_active_scalability_multinet_run(json_conf, json_output, output_dir)[source]¶ Runs the NorthBound scalability test with idle Multinet switches
Parameters: - json_conf (str) – JSON configuration dictionary
- json_output (str) – JSON output file (results)
- output_dir (str) – directory to store output files
-
sb_active_scalability_mtcbench_run(json_conf, json_output, output_dir)[source]¶ Runs the SouthBound scalability or stability test with active MT-Cbench switches
Parameters: - json_conf – JSON configuration dictionary
- json_output – JSON output file (results)
- output_dir – directory to store output files
Type: json_conf: dict
Type: json_output: str
Type: output_dir: str
-
sb_active_scalability_multinet_run(json_conf, json_output, output_dir)[source]¶ Runs the SouthBound scalability test with active Multinet switches
Parameters: - json_conf (dict) – JSON configuration dictionary
- json_output (str) – JSON output file (results)
- output_dir (str) – directory to store output files
-
sb_active_stability_mtcbench_run(json_conf, json_output, output_dir)[source]¶ Runs the SouthBound scalability or stability test with active MT-Cbench switches
Parameters: - json_conf – JSON configuration dictionary
- json_output – JSON output file (results)
- output_dir – directory to store output files
Returns: total_samples: a list of dictionaries (one dict per test run)
Return type: list<dict>
Type: json_conf: dict
Type: json_output: str
Type: output_dir: str
-
sb_idle_scalability_mtcbench_run(json_conf, json_output, output_dir)[source]¶ Runs the SouthBound scalability test with idle MT-Cbench switches
Parameters: - json_conf (dict) – JSON configuration dictionary
- json_output (str) – JSON output file (results)
- output_dir (str) – directory to store output files
-
sb_idle_scalability_multinet_run(json_conf, json_output, output_dir)[source]¶ Runs the SouthBound scalability test with idle Multinet switches
Parameters: - json_conf (dict) – JSON configuration dictionary
- json_output (str) – JSON output file (results)
- output_dir (str) – directory to store output files
-
stress_test.test_type module¶
Controller Class- All controller-related functionality is here
-
class
stress_test.test_type.TestType(args)[source]¶ Bases:
objectCreates a TestType object
-
load_test_conf(args)[source]¶ Loading test configuration for NSTAT experiment. Parsing configuration options from JSON input file
Parameters: args (ArgumentParser object) – ArgumentParser object containing user specified parameters (i.e test type, controller base directory, generator base directory) when running NSTAT Returns: json_conf: Return type: json_conf: python object resulting from a deserialized file like object containing a json document
-