Welcome to OPNFV Functest’s documentation!¶
Contents:
functest¶
functest package¶
Subpackages¶
functest.opnfv_tests package¶
Subpackages¶
Define classes required to run ODL suites.
It has been designed for any context. But helpers are given for running test suites in OPNFV environment.
- Example:
- $ python odl.py
-
class
functest.opnfv_tests.sdn.odl.odl.
ODLParser
¶ Bases:
object
Parser to run ODL test suites.
-
parse_args
(argv=None)¶ Parse arguments.
It can call sys.exit if arguments are incorrect.
- Returns:
- the arguments from cmdline
-
-
class
functest.opnfv_tests.sdn.odl.odl.
ODLTests
(**kwargs)¶ Bases:
xtesting.core.robotframework.RobotFramework
ODL test runner.
-
basic_suite_dir
= '/src/odl_test/csit/suites/integration/basic'¶
-
default_suites
= ['/src/odl_test/csit/suites/integration/basic', '/src/odl_test/csit/suites/openstack/neutron']¶
-
neutron_suite_dir
= '/src/odl_test/csit/suites/openstack/neutron'¶
-
odl_test_repo
= '/src/odl_test'¶
-
odl_variables_file
= '/src/odl_test/csit/variables/Variables.robot'¶
-
run
(**kwargs)¶ Run suites in OPNFV environment
It basically checks env vars to call main() with the keywords required.
- Args:
- kwargs: Arbitrary keyword arguments.
- Returns:
- EX_OK if all suites ran well. EX_RUN_ERROR otherwise.
-
run_suites
(suites=None, **kwargs)¶ Run the test suites
It has been designed to be called in any context. It requires the following keyword arguments:
- odlusername,
- odlpassword,
- osauthurl,
- neutronurl,
- osusername,
- osprojectname,
- ospassword,
- odlip,
- odlwebport,
- odlrestconfport.
- Here are the steps:
- set all RobotFramework_variables,
- create the output directories if required,
- get the results in output.xml,
- delete temporary files.
- Args:
- kwargs: Arbitrary keyword arguments.
- Returns:
- EX_OK if all suites ran well. EX_RUN_ERROR otherwise.
-
classmethod
set_robotframework_vars
(odlusername='admin', odlpassword='admin')¶ Set credentials in csit/variables/Variables.robot.
- Returns:
- True if credentials are set. False otherwise.
-
-
functest.opnfv_tests.sdn.odl.odl.
main
()¶ Entry point
vrouter function test execution module
-
class
functest.opnfv_tests.vnf.router.test_controller.function_test_exec.
FunctionTestExec
(util_info)¶ Bases:
object
vrouter function test execution class
-
config_reference_vnf
(target_vnf, reference_vnf, test_kind)¶
-
config_target_vnf
(target_vnf, reference_vnf, test_kind)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.test_controller.function_test_exec (WARNING)>¶
-
result_check
(target_vnf, reference_vnf, test_kind, test_list)¶
-
run
(target_vnf, reference_vnf_list, test_info, test_list)¶
-
vrouter test result check module
-
class
functest.opnfv_tests.vnf.router.vnf_controller.checker.
Checker
¶ Bases:
object
vrouter test result check class
-
static
load_check_rule
(rule_file_dir, rule_file_name, parameter)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.vnf_controller.checker (WARNING)>¶
-
static
regexp_information
(response, rules)¶
-
static
command generator module for vrouter testing
-
class
functest.opnfv_tests.vnf.router.vnf_controller.command_generator.
CommandGenerator
¶ Bases:
object
command generator class for vrouter testing
-
static
command_create
(template, parameter)¶
-
static
load_template
(template_dir, template)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.vnf_controller.command_generator (WARNING)>¶
-
static
ssh client module for vrouter testing
-
class
functest.opnfv_tests.vnf.router.vnf_controller.ssh_client.
SshClient
(ip_address, user, password=None, key_filename=None)¶ Bases:
object
ssh client class for vrouter testing
-
close
()¶
-
connect
(time_out=10, retrycount=10)¶
-
static
error_check
(response, err_strs=None)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.vnf_controller.ssh_client (WARNING)>¶
-
send
(cmd, prompt, timeout=10)¶
-
vm controll module
-
class
functest.opnfv_tests.vnf.router.vnf_controller.vm_controller.
VmController
(util_info)¶ Bases:
object
vm controll class
-
command_create_and_execute
(ssh, test_cmd_file_path, cmd_input_param, prompt_file_path)¶
-
command_execute
(ssh, command, prompt)¶
-
command_gen_from_template
(command_file_path, cmd_input_param)¶
-
command_list_execute
(ssh, command_list, prompt)¶
-
config_vm
(vm_info, test_cmd_file_path, cmd_input_param, prompt_file_path)¶
-
connect_ssh_and_config_vm
(vm_info, test_cmd_file_path, cmd_input_param, prompt_file_path)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.vnf_controller.vm_controller (WARNING)>¶
-
vrouter controll module
-
class
functest.opnfv_tests.vnf.router.vnf_controller.vnf_controller.
VnfController
(util_info)¶ Bases:
object
vrouter controll class
-
config_vnf
(source_vnf, destination_vnf, test_cmd_file_path, parameter_file_path, prompt_file_path)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.vnf_controller.vnf_controller (WARNING)>¶
-
output_check_result_detail_data
(res_data_list)¶
-
result_check
(target_vnf, reference_vnf, check_rule_file_path_list, parameter_file_path, prompt_file_path)¶
-
Utility module of vrouter testcase
-
class
functest.opnfv_tests.vnf.router.utilvnf.
Utilvnf
¶ Bases:
object
Utility class of vrouter testcase
-
static
convert_functional_test_result
(result_data_list)¶
-
get_address
(server_name, network_name)¶
-
get_blueprint_outputs
(cfy_manager_ip, deployment_name)¶
-
get_blueprint_outputs_networks
(cfy_manager_ip, deployment_name)¶
-
get_blueprint_outputs_vnfs
(cfy_manager_ip, deployment_name)¶
-
get_mac_address
(server_name, network_name)¶
-
static
get_reference_vnf_list
(vnf_info_list)¶
-
static
get_target_vnf
(vnf_info_list)¶
-
static
get_test_scenario
(file_path)¶
-
static
get_vnf_info
(vnf_info_list, vnf_name)¶
-
get_vnf_info_list
(cfy_manager_ip, topology_deploy_name, target_vnf_name)¶
-
logger
= <Logger functest.opnfv_tests.vnf.router.utilvnf (WARNING)>¶
-
output_test_result_json
()¶
-
request_vm_delete
(vnf_info_list)¶
-
set_credentials
(cloud)¶
-
write_result_data
(result_data)¶
-
static
vrouter testing base class module