yardstick.vTC.apexlake.experimental_framework package

Submodules

yardstick.vTC.apexlake.experimental_framework.api module

class yardstick.vTC.apexlake.experimental_framework.api.FrameworkApi[source]

Bases: object

static execute_framework(test_cases, iterations, heat_template, heat_template_parameters, deployment_configuration, openstack_credentials)[source]

Executes the framework according the inputs

Parameters:
  • test_cases

    Test cases to be ran on the workload (dict() of dict())

    Example: test_case = dict() test_case[‘name’] = ‘module.Class’ test_case[‘params’] = dict() test_case[‘params’][‘throughput’] = ‘1’ test_case[‘params’][‘vlan_sender’] = ‘1007’ test_case[‘params’][‘vlan_receiver’] = ‘1006’ test_cases = [test_case]

  • iterations – Number of cycles to be executed (int)
  • heat_template – (string) File name of the heat template of the workload to be deployed. It contains the parameters to be evaluated in the form of #parameter_name. (See heat_templates/vTC.yaml as example).
  • heat_template_parameters – (dict) Parameters to be provided as input to the heat template. See http://docs.openstack.org/developer/heat/ template_guide/hot_guide.html - section “Template input parameters” for further info.
  • deployment_configuration – ( dict[string] = list(strings) ) ) Dictionary of parameters representing the deployment configuration of the workload The key is a string corresponding to the name of the parameter, the value is a list of strings representing the value to be assumed by a specific param. The parameters are user defined: they have to correspond to the place holders (#parameter_name) specified in the heat template.
Returns:

dict() Containing results

static get_test_case_features(test_case)[source]

Returns a list of features (description, requested parameters, allowed values, etc.) for a specified test case.

Parameters:test_case – name of the test case (string) The string represents the test case and can be obtained calling “get_available_test_cases()” method.
Returns:dict() containing the features of the test case
static init()[source]

Initializes the Framework

Returns:None

yardstick.vTC.apexlake.experimental_framework.benchmarking_unit module

The Benchmarking Unit manages the Benchmarking of VNFs orchestrating the initialization, execution and finalization

class yardstick.vTC.apexlake.experimental_framework.benchmarking_unit.BenchmarkingUnit(heat_template_name, openstack_credentials, heat_template_parameters, iterations, benchmarks)[source]

Management of the overall Benchmarking process

static extract_experiment_name(template_file_name)[source]

Generates a unique experiment name for a given template.

Parameters:template_file_name – (str) File name of the template used during the experiment string
Returns:(str) Experiment Name
finalize()[source]

Finalizes the Benchmarking Unit Destroys all the stacks deployed by the framework and save results on csv file.

Returns:None
static get_benchmark_class(complete_module_name)[source]

Returns the classes included in a given module.

Parameters:complete_module_name – (str) Complete name of the module as returned by get_available_test_cases.
Returns:Class related to the benchmark/TC present in the requested module.
get_benchmark_name(name, instance=0)[source]

Returns the name to be used for the benchmark/test case (TC). This is required since each benchmark/TC could be run more than once within the same cycle, with different initialization parameters. In order to distinguish between them, a unique name is generated.

Parameters:
  • name – (str) original name of the benchmark/TC
  • instance – (int) number of instance already in the queue for this type of benchmark/TC.
Returns:

(str) name to be assigned to the benchmark/TC

get_experiment_configuration(template_file_name)[source]

Reads and returns the configuration for the specific experiment (heat template)

Parameters:template_file_name – (str) Name of the file for the heat template for which it is requested the configuration
Returns:dict() Configuration parameters and values
static get_required_benchmarks(required_benchmarks)[source]

Returns instances of required test cases.

Parameters:required_benchmarks – (list() of strings) Benchmarks to be executed by the experimental framework.
Returns:list() of BenchmarkBaseClass
initialize()[source]

Initialize the environment in order to run the benchmarking

Returns:None
run_benchmarks()[source]

Runs all the requested benchmarks and collect the results.

Returns:None

yardstick.vTC.apexlake.experimental_framework.common module

class yardstick.vTC.apexlake.experimental_framework.common.ConfigurationFile(sections, config_file='conf.cfg')[source]

Used to extract data from the configuration file

get_variable(section, variable_name)[source]

Returns the value correspondent to a variable

Parameters:
  • section – section to be loaded (string)
  • variable_name – name of the variable (string)
Returns:

string

get_variable_list(section)[source]

Returns the list of the available variables in a section :param section: section to be loaded (string) :return: list

class yardstick.vTC.apexlake.experimental_framework.common.InputValidation[source]

Bases: object

static validate_boolean(boolean, message)[source]
static validate_configuration_file_parameter(section, parameter, message)[source]
static validate_configuration_file_section(section, message)[source]
static validate_dictionary(param, message)[source]
static validate_directory_exist_and_format(directory, message)[source]
static validate_file_exist(file_name, message)[source]
static validate_integer(param, message)[source]
static validate_os_credentials(credentials)[source]
static validate_string(param, message)[source]
yardstick.vTC.apexlake.experimental_framework.common.get_base_dir()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_benchmarks_from_conf_file()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_credentials()[source]

Returns the credentials for OpenStack access from the configuration file :return: dictionary

yardstick.vTC.apexlake.experimental_framework.common.get_deployment_configuration_variables_from_conf_file()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_dpdk_pktgen_vars()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_file_first_line(file_name)[source]

Returns the first line of a file

Parameters:file_name – name of the file to be read (str)
Returns:str
yardstick.vTC.apexlake.experimental_framework.common.get_heat_template_params()[source]

Returns the list of deployment parameters from the configuration file for the heat template

Returns:dict
yardstick.vTC.apexlake.experimental_framework.common.get_result_dir()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_template_dir()[source]
yardstick.vTC.apexlake.experimental_framework.common.get_testcase_params()[source]

Returns the list of testcase parameters from the configuration file

Returns:dict
yardstick.vTC.apexlake.experimental_framework.common.init(api=False)[source]
yardstick.vTC.apexlake.experimental_framework.common.init_conf_file(api=False)[source]
yardstick.vTC.apexlake.experimental_framework.common.init_general_vars(api=False)[source]
yardstick.vTC.apexlake.experimental_framework.common.init_influxdb()[source]
yardstick.vTC.apexlake.experimental_framework.common.init_log()[source]
yardstick.vTC.apexlake.experimental_framework.common.init_pktgen()[source]
yardstick.vTC.apexlake.experimental_framework.common.push_data_influxdb(data)[source]
yardstick.vTC.apexlake.experimental_framework.common.replace_in_file(file, text_to_search, text_to_replace)[source]

Replaces a string within a file

Parameters:
  • file – name of the file (str)
  • text_to_search – text to be replaced
  • text_to_replace – new text that will replace the previous
Returns:

None

yardstick.vTC.apexlake.experimental_framework.common.run_command(command)[source]

yardstick.vTC.apexlake.experimental_framework.deployment_unit module

class yardstick.vTC.apexlake.experimental_framework.deployment_unit.DeploymentUnit(openstack_credentials)[source]

This unit is in charge to manage the deployment of the workloads under test and any other workloads necessary to the benchmark

deploy_heat_template(template_file, stack_name, parameters, attempt=0)[source]

Deploys a heat template and in case of failure retries 3 times :param template_file: full path file name of the heat template :param stack_name: name of the stack to deploy :param parameters: parameters to be given to the heat template :param attempt: number of current attempt :return: returns True in case the creation is completed

returns False in case the creation is failed
destroy_all_deployed_stacks()[source]

Destroys all the stacks currently deployed :return: None

destroy_heat_template(stack_name)[source]

Destroys a stack :param stack_name: Stack of the name to be destroyed (sting) :return: None

yardstick.vTC.apexlake.experimental_framework.heat_manager module

class yardstick.vTC.apexlake.experimental_framework.heat_manager.HeatManager(credentials)[source]
check_stack_status(stack_name)[source]

Returns a string representing the status of a stack from Heat perspective :param stack_name: Name of the stack to be checked (type: str) :return: (type: str)

create_stack(template_file, stack_name, parameters)[source]
delete_stack(stack_name)[source]
init_heat()[source]
is_stack_deployed(stack_name)[source]
print_stacks(name=None)[source]
validate_heat_template(heat_template_file)[source]

yardstick.vTC.apexlake.experimental_framework.heat_template_generation module

Generation of the heat templates from the base template

class yardstick.vTC.apexlake.experimental_framework.heat_template_generation.TreeNode[source]

This class represent the node of the configuration tree. Each node represents a single configuration value for a single configuration parameter.

add_child(node)[source]

Adds a node as a child for the current node :param node: node to be added as a child (type: TreeNode) :return: None

get_children()[source]

Returns the children of the current node :return type: list of TreeNode

static get_leaves(node)[source]

Returns all the leaves of a tree. :param node: root of the tree (TreeNode) :return type: list

get_parent()[source]

Returns the parent node of the current one :return type: TreeNode

get_path()[source]

Returns all the path from the current node to the root of the tree. :return type: list of TreeNode

get_variable_name()[source]

Returns the name of the variable correspondent to the current node :return type: str

get_variable_value()[source]

Returns the value of the variable correspondent to the current node :return type: str or int

set_variable_name(name)[source]

Sets the name of the variable for the current node :param name: Name of the variable (type: str) :return None

set_variable_value(value)[source]

Sets the value of the variable for the current node :param value: value of the variable (type: str) :return None

yardstick.vTC.apexlake.experimental_framework.heat_template_generation.generates_templates(base_heat_template, deployment_configuration)[source]

Generates the heat templates for the experiments :return: None

yardstick.vTC.apexlake.experimental_framework.heat_template_generation.get_all_heat_templates(template_dir, template_file_extension)[source]

Loads and returns all the generated heat templates :param template_dir: directory to search in (type: str) :param template_file_extension: extension of the file for templates

(type: str)
Returns:type: list

Module contents

Experimental Framework