unittests

Submodules

unittests.common

common.py

Unittests common functionality

class unittests.common.FakeXMLRPCServer(port=9999)[source]

Bases: object

applications_exists(app_id, pid_id, app_name)[source]
applications_find(app_id, pid_id, app_name)[source]
applications_get_size()[source]
applications_gettable()[source]
applications_set_loglevel(app_id, loglevel)[source]
clear_config()[source]
lags_add_row(*row)[source]
lags_get_size()[source]
lags_get_table()[source]
method_help(method)[source]
platform_get_row(row)[source]
platform_get_size()[source]
platform_get_table()[source]
ports_add_row(*row)[source]
ports_del_row(row_id)[source]
ports_get_info()[source]
ports_get_info_name()[source]
ports_get_name(row_id)[source]
ports_get_size()[source]
ports_gettable()[source]
ports_lag_add_row(*row)[source]
ports_lags_get_size()[source]
ports_lags_get_table()[source]
start()[source]
stop()[source]
system_multicall(*calls)[source]
system_tables_ready()[source]

unittests.conftest

conftest.py

TAF unittests common options

unittests.conftest.env_setup(request)[source]
unittests.conftest.pytest_addoption(parser)[source]

unittests.test_ab_parser

test_ab_parser.py

class unittests.test_ab_parser.TestAbParser[source]

Bases: object

test_aggregation()[source]
test_parsing_of_single_ab_output()[source]

unittests.test_clicmd

unittests.test_clissh

unittests.test_collectd

test_collectd.py

Collectd library unittests

class unittests.test_collectd.TestCollectd[source]

Bases: object

setup_tests()[source]
test_collectd_restart()[source]
test_collectd_start()[source]
test_collectd_stop()[source]

unittests.test_common3

unittests.test_dependencies_core

test_dependencies_core.py

Unittests for dependencies core functions

class unittests.test_dependencies_core.FakeOpts[source]

Bases: object

FakeOpts class.

__init__()[source]

Initialize FakeOpts class.

unittests.test_dependencies_core.test_import_afs_module()[source]

Verify that all modules can be imported within ‘afs’ module and ‘AFS’ object can be created.

unittests.test_dependencies_core.test_import_afscross_module()[source]

Verify that all modules can be imported within ‘afs’ module and ‘AFS’ object can be created.

unittests.test_dependencies_core.test_import_clicmd_module()[source]

Verify that all modules can be imported within ‘clicmd’ module and ‘CLICmd’ object can be created.

unittests.test_dependencies_core.test_import_clissh_module()[source]

Verify that all modules can be imported within ‘clissh’ module and ‘CLISSH’ object can be created.

unittests.test_dependencies_core.test_import_common3_module(monkeypatch)[source]

Verify that all modules can be imported within ‘common3’ module and ‘Cross’/’Environment’ objects can be created.

unittests.test_dependencies_core.test_import_connpool_module()[source]

Verify that all modules can be imported within ‘connpool’ module and ‘ConnectionPool’ object can be created.

unittests.test_dependencies_core.test_import_custom_exception_module()[source]

Verify that all modules can be imported within ‘custom_exception’ module and object of classes can be created.

unittests.test_dependencies_core.test_import_dev_basecross_module()[source]

Verify that all modules can be imported within ‘dev_basecross’ module and classes objects can be created.

unittests.test_dependencies_core.test_import_dev_linux_host_module()[source]

Verify that all modules can be imported within ‘dev_linux_host’ module and classes objects can be created.

unittests.test_dependencies_ons

test_dependencies_ons.py

Unittests for dependencies functions

unittests.test_dependencies_ons.check_module_name_error_status(module_name)[source]

The function return True if name error is present in module during importing.

unittests.test_dependencies_ons.test_import_dev_staticcross_ons_module()[source]

Verify that all modules can be imported within ‘dev_staticcross_ons’ module and classes objects can be created.

unittests.test_dependencies_ons.test_import_dev_switches_module()[source]

Verify that all modules can be imported within ‘dev_switches’ module and classes objects can be created.

unittests.test_dependencies_ons.test_import_helpers_module()[source]

Verify that all modules can be imported within ‘helpers’ module and classes objects can be created.

unittests.test_dev_linux_host

unittests.test_fixtures

unittests.test_getports

test_getports.py

Unittests for getting ports functions

class unittests.test_getports.FakeOpts[source]

Bases: object

FakeOpts class.

build_path = ''
env = 'setup.json'
get_only = False
setup = 'setup.json'
ui = 'ons_xmlrpc'
unittests.test_getports.env_golden(request, monkeypatch)[source]

Fixture of environment for unittests of methods get_ports and get_speed.

unittests.test_getports.env_simple(request, monkeypatch)[source]

Fixture of environment for unittests of methods get_ports and get_speed.

unittests.test_getports.test_getports01(env_golden)[source]
unittests.test_getports.test_getports02(env_simple)[source]
unittests.test_getports.test_getports03(env_golden)[source]

unittests.test_helpers

test_helpers.py

Unittests for helpers functions

class unittests.test_helpers.Config(env)[source]

Bases: object

class unittests.test_helpers.Device(stype)[source]

Bases: object

class unittests.test_helpers.Env(switches, tgs)[source]

Bases: object

class unittests.test_helpers.Options[source]

Bases: object

class unittests.test_helpers.TestGetAttribute[source]

Bases: object

test_is_namedtuple()[source]
test_is_not_found()[source]
test_is_not_found_with_decorator()[source]
test_namedtuple_is_decorator()[source]
test_unnamedtuple()[source]
test_unnamedtuple_is_decorator()[source]
class unittests.test_helpers.TestGetSteppedValue[source]

Bases: object

test_get_stepped_value_int()[source]
test_get_stepped_value_invalid()[source]
test_get_stepped_value_ordereddict()[source]
class unittests.test_helpers.TestGrouper[source]

Bases: object

test_grouper_1()[source]
test_grouper_3()[source]
test_grouper_bigger()[source]
test_grouper_empty()[source]
test_grouper_negative()[source]
unittests.test_helpers.test_realswitch_only_marker()[source]
unittests.test_helpers.test_run_on_platforms_marker()[source]
unittests.test_helpers.test_run_on_tg_marker()[source]
unittests.test_helpers.test_run_on_ui_marker()[source]
unittests.test_helpers.test_simswitch_only_marker()[source]
unittests.test_helpers.test_skip_on_platforms_marker()[source]
unittests.test_helpers.test_skip_on_tg_marker()[source]
unittests.test_helpers.test_skip_on_ui_marker()[source]

unittests.test_linux_host_bash

test_ui_onpss_shell.py

Unittests for UI ONPSS Shell

class unittests.test_linux_host_bash.OnpssRawOutput[source]

Bases: object

unittests.test_linux_host_bash.make_multicall_ports_side_effect(iplink_out, ethtool_out, pci_out)[source]
unittests.test_linux_host_bash.make_ports_side_effect(iplink_out, ethtool_out, pci_out)[source]
unittests.test_linux_host_bash.test_get_table_ports(ui)[source]
unittests.test_linux_host_bash.test_get_table_ports_no_ethtool(ui)[source]
unittests.test_linux_host_bash.ui()[source]

unittests.test_loggers

test_loggers.py

Unittests for logging functionality in TAF

class unittests.test_loggers.TestLogger[source]

Bases: object

classmethod teardown_class()[source]

Removes all created files and directory on teardown of class.

test_debug_log_message(skip_if_no_fixture, caplog, simple_log, request)[source]

Verify that log message for level DEBUG contains correct values.

test_error_log_message(skip_if_no_fixture, caplog, simple_log, request)[source]

Verify that log message for level ERROR contains correct values.

test_info_log_message(skip_if_no_fixture, caplog, simple_log, request)[source]

Verify that log message for level INFO contains correct values.

test_log_message_for_exception(skip_if_no_fixture, caplog, exception_log, request, log_file)[source]

Verify that log message for exception from log files contains correct values.

test_log_message_for_exception_with_trace(skip_if_no_fixture, caplog, request)[source]

Verify that log messages for exception with trace contains correct values.

test_log_message_for_introspection(skip_if_no_fixture, caplog, introspection_log, request, log_file)[source]

Verify that log message for introspection from log files contains correct values.

test_log_message_from_log_file_for_exception_with_trace(skip_if_no_fixture, caplog, request, log_file, exception_log, monkeypatch)[source]

Verify that log messages for exception with trace from log files contains correct values.

test_log_message_from_log_files(skip_if_no_fixture, caplog, file_log, request, log_file)[source]

Verify that log message from log files contains correct values.

test_loggers_mkdir()[source]

Verify that method mkdir_p creates directory.

test_loggers_options_and_mkdir(request)[source]

Verify that dictionary of logging options contains correct values and method mkdir_p is not creates directory if it exists.

test_module_log_message(skip_if_no_fixture, caplog, request, module_log)[source]

Verify that module level logging contains correct values.

test_warning_log_message(skip_if_no_fixture, caplog, simple_log, request)[source]

Verify that log message for level WARNING contains correct values.

unittests.test_loggers.exception_log(request)[source]
unittests.test_loggers.file_log(request)[source]
unittests.test_loggers.introspection_log(request)[source]
unittests.test_loggers.log_file(request)[source]
unittests.test_loggers.module_log(request)[source]
unittests.test_loggers.remove_logger(logger)[source]
unittests.test_loggers.simple_log(request)[source]
unittests.test_loggers.skip_if_no_fixture(request)[source]

unittests.test_multicall

test_multicall.py

Test Multicall

class unittests.test_multicall.TestMultiCall[source]

Bases: object

test_individual_element_lists_in_worst_case()[source]
test_original_list_if_small_enough()[source]
test_single_split()[source]

unittests.test_pwsw

test_pwsw.py

Unittests powerboard functions

unittests.test_pwsw.test_pwsw1()[source]

unittests.test_pytest_helpers

test_pytest_helpers.py

Unittests for helpers functions

unittests.test_pytest_helpers.report()[source]
unittests.test_pytest_helpers.test_bad_fixture_param_value_is_handled()[source]
unittests.test_pytest_helpers.test_bad_fixture_param_value_is_handled_with_parametrize()[source]
unittests.test_pytest_helpers.test_brackets_are_removed()[source]
unittests.test_pytest_helpers.test_get_brief_callspec()[source]
unittests.test_pytest_helpers.test_get_brief_doc()[source]
unittests.test_pytest_helpers.test_get_brief_docstring()[source]
unittests.test_pytest_helpers.test_get_brief_inspect()[source]
unittests.test_pytest_helpers.test_get_failure_reason()[source]

Check if get_failure_reason(data) is work correct.

unittests.test_pytest_helpers.test_get_failure_reason_TypeError_returns_None()[source]
unittests.test_pytest_helpers.test_get_html_xml_path_non_string()[source]
unittests.test_pytest_helpers.test_get_skipped_reason_TypeError_returns_None()[source]
unittests.test_pytest_helpers.test_get_steps_callspec()[source]
unittests.test_pytest_helpers.test_get_steps_doc()[source]
unittests.test_pytest_helpers.test_get_steps_docstring()[source]
unittests.test_pytest_helpers.test_get_steps_inspect()[source]
unittests.test_pytest_helpers.test_get_suite_name()[source]

Test of pytest_helpers.get_tcname() function.

unittests.test_pytest_helpers.test_tcname_argvalue(report)[source]
unittests.test_pytest_helpers.test_tcname_basic(report)[source]

Test of pytest_helpers.get_tcname() function.

unittests.test_pytest_helpers.test_tcname_keywords(report)[source]

unittests.test_pytest_loganalyzer

unittests.test_reporting_server

test_reporting_server.py

Unittests for reporting server functions

unittests.test_reporting_server.reporting_server()[source]
unittests.test_reporting_server.reporting_server_with_config(reporting_server)[source]
unittests.test_reporting_server.test_client_config(reporting_server)[source]

Verify that client config can be created and reports can be removed.

unittests.test_reporting_server.test_cmdproc(reporting_server_with_config)[source]

Verify that operation with cmdproc is work.

unittests.test_reporting_server.test_post(reporting_server_with_config)[source]

Verify that post command is True.

unittests.test_reporting_server.test_queue(reporting_server_with_config)[source]

Verify that operation with queue is working.

unittests.test_service_lib

test_service_lib.py

SystemD service library unittests

class unittests.test_service_lib.TestSpecificServiceManager(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_list_is_not_present_in_SpecificServiceManager()[source]
test_start()[source]
test_stop_with_args()[source]
class unittests.test_service_lib.TestSystemd(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_all_commands()[source]
class unittests.test_service_lib.TestSystemdServiceManager(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_list()[source]
test_set_default_runlevel()[source]
test_start()[source]

unittests.test_staticcross

test_staticcross.py

Unittests for static cross functions

class unittests.test_staticcross.FakeDev1[source]

Bases: object

connect_port(port)[source]
disconnect_port(port)[source]
class unittests.test_staticcross.FakeDev2[source]

Bases: object

connect_port(port)[source]
disconnect_port(port)[source]
class unittests.test_staticcross.FakeOpts[source]

Bases: object

build_path = ''
env = ''
get_only = False
setup = 'setup.json'
unittests.test_staticcross.cross(request, monkeypatch)[source]
unittests.test_staticcross.test_staticcross_connect(cross)[source]
unittests.test_staticcross.test_staticcross_disconnect(cross)[source]
unittests.test_staticcross.test_staticcross_get_device(cross)[source]

unittests.test_switch_driver

unittests.test_synapsert

test_synapsert.py

Unittests for synapsert functions

unittests.test_synapsert.synapsert(request)[source]

Return synapsert instant.

“–synapsert_config” option set path to synapsert config file, if not defined, current synapsert config will be use

unittests.test_synapsert.tc_issue(synapsert, tc_name)[source]
unittests.test_synapsert.tc_name(synapsert, request)[source]
unittests.test_synapsert.test_create_test_case(synapsert, tc_issue)[source]
unittests.test_synapsert.test_create_test_plan(synapsert, tp_issue)[source]
unittests.test_synapsert.test_get_custom_fields(synapsert)[source]

Verify if all customfields created.

unittests.test_synapsert.test_get_issue_type(synapsert)[source]

Verify if issue exists.

unittests.test_synapsert.test_get_suite_value(synapsert)[source]

Verify value of suites.

unittests.test_synapsert.test_get_tc_by_auto_tc_name(synapsert, tc_issue)[source]
unittests.test_synapsert.test_jira_exist(synapsert)[source]
unittests.test_synapsert.test_set_suite(synapsert, tc_issue)[source]
unittests.test_synapsert.test_transition(synapsert, tc_issue, tp_issue)[source]
unittests.test_synapsert.tp_issue(synapsert, tp_name)[source]
unittests.test_synapsert.tp_name(synapsert, request)[source]

unittests.test_ui_helpers

unittests.test_ui_iss_cli

test_ui_iss_cli.py

ISS CLI UI wrappers.unittests

unittests.test_ui_onpss_jsonrpc

unittests.test_ui_onpss_shell

unittests.test_ui_xmlrpc

unittests.test_ui_xmlrpc

unittests.linux.test_commands

test_commands.py

Command helpers Unittests

class unittests.linux.test_commands.TestCmdHelperBasic[source]

Bases: object

test_copy()[source]
test_empty_argparse_raises_exception(**kwargs)[source]
test_get()[source]
test_inits()[source]
test_iter()[source]
test_update()[source]
test_validate_dict()[source]
class unittests.linux.test_commands.TestCommandHelper[source]

Bases: object

test_cmd_helper_mkdir_kwarg_unset()[source]
test_cmd_helper_mkdir_kwargs_extend()[source]
test_cmd_helper_mkdir_kwargs_set()[source]
test_cmd_helper_mkdir_kwargs_update()[source]
test_cmd_helper_mkdir_merge()[source]
test_cmd_helper_start_empty()[source]
test_cmd_helper_start_ok()[source]
test_cmd_helper_start_unknown()[source]
unittests.linux.test_commands.pytest_raises(exc_iter)[source]

unittests.linux.test_iperf

test_iperf.py

IPerfRunner Unittests

class unittests.linux.test_iperf.TestIPerfParser[source]

Bases: object

test_multi_thread_client_output()[source]
test_multi_thread_server_output()[source]
test_single_thread_client_output()[source]
test_single_thread_client_output_gbytes_format()[source]
test_single_thread_server_output()[source]
test_single_thread_server_output_gbits_format()[source]
class unittests.linux.test_iperf.TestIperf[source]

Bases: object

classmethod _parse_linux_cmd(cmd_str, name=None)[source]

Extract the command arguments from a linux command line string.

host = '127.0.0.1'
password = 'admin'
runner()[source]
test_iperf_runner_get_results(runner)[source]
test_iperf_runner_parse(runner)[source]
test_iperf_runner_parse_gbytes_format(runner)[source]
test_iperf_runner_start_client_command(runner)[source]
test_iperf_runner_start_client_empty(runner)[source]
test_iperf_runner_start_client_kwargs(runner)[source]
test_iperf_runner_start_client_with_options(runner)[source]
test_iperf_runner_start_empty(runner)[source]
test_iperf_runner_start_server_and_client(runner)[source]
test_iperf_runner_start_server_command(runner)[source]
test_iperf_runner_start_server_command_kwargs(runner)[source]
test_iperf_runner_start_server_empty(runner)[source]
test_iperf_runner_start_server_kwargs(runner)[source]
test_iperf_runner_start_server_with_options(runner)[source]
test_iperf_runner_start_unknown(runner)[source]
user = 'admin'

unittests.linux.test_networkd

test_networkd.py

NetworkD Unittests

class unittests.linux.test_networkd.TestNetworkD[source]

Bases: object

test_empty_list()[source]
test_extra_excludes_are_appended()[source]
test_just_extra_excludes()[source]
test_multiple_mgmt_port()[source]
test_single_mgmt_port()[source]

unittests.linux.test_parser

test_parser.py

Parse tools Unittests

class unittests.linux.test_parser.TestParser[source]

Bases: object

HOST_LEXER = <pygments.lexers.HostLexer>
HOST_PARSER = <testlib.linux.suricata.parser.HostParser object>
test_lexer_lexem_error()[source]
test_lexer_lexem_ok()[source]
test_lexer_tokenizer()[source]
test_parser_semantics_fail_duplicates()[source]
test_parser_semantics_ok()[source]
test_parser_synax_error_unexpected_token()[source]
test_parser_syntax_error_tokens_overflow()[source]
test_parser_syntax_error_tokens_underflow()[source]
test_parser_syntax_ok()[source]

unittests.linux.test_tool_general

unittests.switches.conftest

conftest.py

Test switches common options

unittests.switches.conftest.pytest_addoption(parser)[source]

TAF specific options.

unittests.switches.test_switches

unittests.test_plugins.test_multiple_run

test_multiple_run.py

Unittests for pytest_multiple_run plugin

class unittests.test_plugins.test_multiple_run.TestPluginMultipleRun[source]

Bases: object

test_rerun_all_test_suite(testdir)[source]

Verify that can rerun 3 times test module.

test_rerun_extra_keyword_1(testdir)[source]

Verify that can rerun 3 times only matched extra keywords(option “-k”).

test_rerun_extra_keyword_2(testdir)[source]

Verify that can rerun 3 times only matched extra keywords(option “-k”).

test_rerun_failed_test(testdir)[source]

Verify that can rerun failed test 7 times.

test_rerun_parametrizing_tests(testdir)[source]

Verify that can rerun parametrizing test 2 times.

test_rerun_passed_test(testdir)[source]

Verify that can rerun success test 7 times.

test_rerun_skipped_test(testdir)[source]

Verify that can rerun skipped test 5 times.

test_rerun_test_with_collectonly_option(testdir)[source]

Verify that only collects tests, don’t executes them.

test_rerun_test_with_exitfirst_option(testdir)[source]

Verify that exits instantly on first error or failed test.

test_rerun_test_with_fixture(testdir)[source]

Verify that can rerun test 2 times with fixture.

test_rerun_test_with_own_mark(testdir)[source]

Verify that can rerun test 2 times with own mark.

test_rerun_test_with_runxfail_option(testdir)[source]

Verify that can rerun test 5 times with mark xfail and option runxfail.

test_rerun_test_with_skipif_mark(testdir)[source]

Verify that can rerun test 5 times with mark skipif.

test_rerun_test_with_xfail_mark(testdir)[source]

Verify that can rerun test 5 times with mark xfail.

unittests.test_plugins.test_multipletg

test_multipletg.py

Unittests for pytest_multipletg plugin

class unittests.test_plugins.test_multipletg.EnvTest(setup, env)[source]

Bases: object

start(request, monkeypatch)[source]
class unittests.test_plugins.test_multipletg.FakeOpts[source]

Bases: object

build_path = ''
env = ''
get_only = True
setup = 'setup.json'
ui = 'ons_xmlrpc'
unittests.test_plugins.test_multipletg.env(request, monkeypatch)[source]

Fixture of environment with LXC for unittests of methods get_ports and get_speed.

unittests.test_plugins.test_multipletg.env_complex(request, monkeypatch)[source]

Fixture of environment with LXC for unittests of methods get_ports and get_speed.

unittests.test_plugins.test_multipletg.env_list(request, monkeypatch)[source]

Fixture of environment with LXC for unittests of methods get_ports and get_speed.

unittests.test_plugins.test_multipletg.test_multipletg_1(request, env)[source]

Verify pytest_multipletg plugin creates MultipleTG instance and modifies env.tg dict.

unittests.test_plugins.test_multipletg.test_multipletg_2(request, env)[source]

Verify pytest_multipletg plugin modifies cross section.

unittests.test_plugins.test_multipletg.test_multipletg_3(request, env)[source]

Verify pytest_multipletg plugin restores env.tg dict on teardown.

unittests.test_plugins.test_multipletg.test_multipletg_4(request, env)[source]

Verify pytest_multipletg plugin restores cross section on teardown.

unittests.test_plugins.test_multipletg.test_multipletg_5(request, env_list)[source]

Verify pytest_multipletg plugin creates port_list if it is in setup.

unittests.test_plugins.test_multipletg.test_multipletg_6(request, env_complex)[source]

Verify pytest_multipletg plugin modifies cross section in complex setup.

unittests.test_plugins.test_pidchecker

test_pidchecker.py

Unittests for pytest_pidchecker.py

class unittests.test_plugins.test_pidchecker.Config(pidchecker)[source]

Bases: object

__call__(x)[source]
class unittests.test_plugins.test_pidchecker.FakeItem(monkeypatch, pidchecker)[source]

Bases: object

class unittests.test_plugins.test_pidchecker.FakeOpts[source]

Bases: object

__init__()[source]
class unittests.test_plugins.test_pidchecker.GetMarker[source]

Bases: object

__call__(x)[source]
class unittests.test_plugins.test_pidchecker.GetProc[source]

Bases: object

__call__(x, skip_prcheck=None)[source]
class unittests.test_plugins.test_pidchecker.Option(pidchecker)[source]

Bases: object

class unittests.test_plugins.test_pidchecker.Setup[source]

Bases: object

__call__(x)[source]
unittests.test_plugins.test_pidchecker.test_pidchecker_setup_false(monkeypatch)[source]
unittests.test_plugins.test_pidchecker.test_pidchecker_setup_true(monkeypatch)[source]
unittests.test_plugins.test_pidchecker.test_pidchecker_teardown_false(monkeypatch)[source]
unittests.test_plugins.test_pidchecker.test_pidchecker_teardown_true(monkeypatch)[source]

unittests.test_plugins.test_pytest_skip_filter

unittests.test_plugins.test_tc_duration

test_tc_duration.py

Unittests for pytest_test_duration plugin

class unittests.test_plugins.test_tc_duration.TestCountTiming[source]

Bases: object

Class verifies count and timing parameters of test duration.

test_count()[source]

Verify that test ends after value of count when count is passed.

test_count_float()[source]

Verify that test ends after integer value of count when float value of count is passed.

test_count_less_than_timing()[source]

Verify that test ends after value of count when time of count less than timing is passed.

test_count_negative()[source]

Verify that test ends after 1 count when negative value of count is passed.

test_count_when_timing_zero()[source]

Verify that test ends after value of count when zero value of timing is passed.

test_count_zero()[source]

Verify that test ends after 1 count when zero value of count is passed.

test_no_parameter()[source]

Verify that test ends after 1 count when no parameter is passed.

test_nonexistent_time()[source]

Verify that test ends after 1 count when timing by nonexistent time is passed.

test_timing_float()[source]

Verify that test ends after value of timing when float value of timing is passed.

test_timing_less_than_count()[source]

Verify that test ends after value of timing when timing less than time of count is passed.

test_timing_negative()[source]

Verify that test ends after 1 count when negative value of timing is passed.

test_timing_second()[source]

Verify that test ends after value of timing when timing is passed.

test_timing_when_count_zero()[source]

Verify that test ends after value of timing when zero value of count is passed.

test_timing_zero()[source]

Verify that test ends after 1 count when zero value of timing is passed.

class unittests.test_plugins.test_tc_duration.TestOptionCountTiming[source]

Bases: object

Class verifies count, timing and option parameters of test duration.

test_count_less_than_option()[source]

Verify that test ends after value of count when time of count less than option is passed.

test_count_less_than_option_and_timing()[source]

Verify that test ends after value of count when count less than option and timing is passed.

test_count_when_option_zero()[source]

Verify that test ends after value of count when zero value of option is passed.

test_count_when_timing_and_option_zero()[source]

Verify that test ends after value of count when zero value of option and timing is passed.

test_option_float()[source]

Verify that test ends after value of option when float value of option is passed.

test_option_less_than_count()[source]

Verify that test ends after value of option when option less than time of count is passed.

test_option_less_than_timing()[source]

Verify that test ends after value of option when option less than timing is passed.

test_option_less_timing_and_count()[source]

Verify that test ends after value of option when option less than timing and count is passed.

test_option_negative()[source]

Verify that test ends after 1 count when negative value of option is passed.

test_option_second()[source]

Verify that test ends after value of option when option is passed.

test_option_when_count_zero()[source]

Verify that test ends after value of option when zero value of count is passed.

test_option_when_timing_and_count_zero()[source]

Verify that test ends after value of option when zero value of timing and count is passed.

test_option_when_timing_zero()[source]

Verify that test ends after value of option when zero value of timing is passed.

test_option_zero()[source]

Verify that test ends after 1 count when zero value of option is passed.

test_timing_less_than_option()[source]

Verify that test ends after value of timing when timing less than option is passed.

test_timing_less_than_option_and_count()[source]

Verify that test ends after value of timing when timing less than option and count is passed.

test_timing_when_option_and_count_zero()[source]

Verify that test ends after value of timing when zero value of option and count is passed.

test_timing_when_option_zero()[source]

Verify that test ends after value of timing when zero value of option is passed.

unittests.test_plugins.test_tempest

test_tempest.py

Unittests for pytest_tempest.py.

unittests.test_plugins.test_tempest.test_init_tempest()[source]

unittests.traffic_generator.conftest

unittests.traffic_generator.packet_constants

packet_constants.py

Packet constants

unittests.traffic_generator.test_ixnet

unittests.traffic_generator.test_pp

test_pp.py

Packet Processor’s unittests

class unittests.traffic_generator.test_pp.TestPacketProcessor[source]

Bases: object

test_assembling_dot1q_icmp_packet_1(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet.

test_assembling_dot1q_icmp_packet_10(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Duplicate fragment 2.

test_assembling_dot1q_icmp_packet_11(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Two packets.

test_assembling_dot1q_icmp_packet_12(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Four packets (fragmented and not).

test_assembling_dot1q_icmp_packet_2(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Overlapped fragments.

test_assembling_dot1q_icmp_packet_3(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Missed fragment 1.

test_assembling_dot1q_icmp_packet_4(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Wrong frag in Fragment 1.

test_assembling_dot1q_icmp_packet_5(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Wrong flags in Fragment 1.

test_assembling_dot1q_icmp_packet_6(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Missed last fragment.

test_assembling_dot1q_icmp_packet_7(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Wrong frag in last fragment.

test_assembling_dot1q_icmp_packet_8(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Wrong flags in last fragment.

test_assembling_dot1q_icmp_packet_9(tg)[source]

Check assembling of Dot1Q.ICMP fragmented packet. Missed fragment after 2.

test_check_packet_field_1(tg)[source]
test_get_lcount(tg)[source]

Verify that method get_lcount returns correct count of layers.

test_get_lfield(tg)[source]

Verify that method get_lfield returns correct value.

test_get_packet_field_1(tg)[source]

Verify that method get_packet_field returns correct value(1).

test_get_packet_field_2(tg)[source]

Verify that method get_packet_field returns correct value(2).

test_get_packet_field_3(tg)[source]

Verify that method get_packet_field returns correct value(3).

test_get_packet_field_4(tg)[source]

Verify that method get_packet_field returns correct value(4).

test_get_packet_field_negative_1(tg)[source]

Verify that method get_packet_field returns Error message when layer is not defined in packet(1).

test_get_packet_field_negative_2(tg)[source]

Verify that method get_packet_field returns Error message when layer is not defined in packet(2).

test_get_packet_field_negative_3(tg)[source]

Verify that method get_packet_field returns Error message when field is not defined in packet(1).

test_packet_with_empty_layer(tg)[source]

Test building packet with empty layer.

test_pproc_packet_field_setting(tg)[source]

Check packet field setting.

test_rechecksum(tg)[source]

Verify that method rechecksum returns correct value.

test_set_field(tg)[source]

Verify that method set_field sets correct field value.

unittests.traffic_generator.test_tg

test_tg.py

Traffic generator’s unittests

class unittests.traffic_generator.test_tg.TestTGs[source]

Bases: object

pytestmark = [Mark(name='unittests', args=(), kwargs={})]
test_arp_incrementation_dot1q_disabled_1(tg)[source]

Check arp incrementation. Count == Increment count. Dot1Q disabled.

test_arp_incrementation_dot1q_disabled_2(tg)[source]

Check arp incrementation. Count == 2*Increment count. Dot1Q disabled.

test_arp_incrementation_dot1q_enabled(tg)[source]

Check arp incrementation. Count == Increment count. Dot1Q enabled.

test_arp_sniff_pattern(tg)[source]

Verify ARP sniff pattern.

test_build_bgp_notification_packet(tg)[source]

Check building BGPNotification packet.

test_build_bgp_packet_as_path(tg)[source]

Check building BGP packet with multiple as_path.

test_build_bgp_packet_simple(tg)[source]

Check building BGP packet.

test_check_increment_arp_hwsrc(tg)[source]

Check all fields in incremented packet. APR.hwsrc increment.

test_check_increment_arp_psrc(tg)[source]

Check all fields in incremented packet. APR.psrc increment.

test_check_increment_dot1q_vlan_double(tg)[source]

Check all fields in incremented packet. Dot1Q.vlan increment.

test_check_increment_dot1q_vlan_single(tg)[source]

Check all fields in incremented packet. Dot1Q.vlan increment.

test_check_increment_igmp_ip(tg)[source]

Check all fields in incremented packet. IGMP.ip increment.

test_check_increment_ip_dscp(tg)[source]

Check all fields in incremented packet. IP.tos increment.

test_check_increment_ip_dst(tg)[source]

Check all fields in incremented packet. IP.dst increment.

test_check_increment_ip_icmp(tg)[source]

Check all fields in incremented packet. IP.src increment.

test_check_increment_ip_proto(tg)[source]

Check all fields in incremented packet. IP.proto increment.

test_check_increment_ip_src(tg)[source]

Check all fields in incremented packet. IP.src increment.

test_check_increment_udp_dport(tg)[source]

Check all fields in incremented packet. UDP.dport increment.

test_check_increment_udp_sport(tg)[source]

Check all fields in incremented packet. UDP.sport increment.

test_check_statistics(tg)[source]

Send 100 packets and check statistics.

test_clear_and_check_statistics(tg)[source]

Send 100 packets, clear and check statistics.

test_da_incrementation_1(tg)[source]

Check DA incrementation. Count == Increment count.

test_da_incrementation_2(tg)[source]

Check DA incrementation. Count > Increment count.

test_da_incrementation_continuous_traffic(tg)[source]

Check DA incrementation. Continuous traffic.

test_default_ether_type(tg)[source]

Verify that default Ether type for tagged packets is equal to 0x8100.

test_dhcp_ip_incrementation(tg)[source]

Check dhcp ip incrementation. Count == Increment count.

test_dot1q_arp_custom_filter(tg)[source]

Check Dot1Q.ARP filter.

test_dot1q_arp_filter(tg)[source]

Check Dot1Q.ARP filter.

test_dot1q_custom_filter(tg)[source]

Check Dot1Q filter.

test_dot1q_filter(tg)[source]

Check Dot1Q filter.

test_dot1q_icmp_custom_filter(tg)[source]

Check Dot1Q.ICMP filter.

test_dot1q_icmp_filter(tg)[source]

Check Dot1Q.ICMP filter.

test_dot1q_ip_custom_filter(tg)[source]

Check Dot1Q.IP filter.

test_dot1q_ip_filter(tg)[source]

Check Dot1Q.IP filter.

test_dot1q_tcp_custom_filter(tg)[source]

Check Dot1Q.TCP filter.

test_dot1q_tcp_filter(tg)[source]

Check Dot1Q.TCP filter.

test_dot1q_udp_custom_filter(tg)[source]

Check Dot1Q.UDP filter.

test_dot1q_udp_filter(tg)[source]

Check Dot1Q.UDP filter.

test_double_tagged_packet_1(tg)[source]

Verify that pypacker can recognize QinQ packets type 0x9100.

test_double_tagged_packet_2(tg)[source]

Verify that pypacker can recognize QinQ packets type 0x88A8.

test_dscp_incrementation_dot1q_disabled_1(tg)[source]

Check dscp incrementation. Count == Increment count. Dot1Q disabled.

test_dscp_incrementation_dot1q_disabled_2(tg)[source]

Check dscp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_dst_ip_incrementation_dot1q_disabled_1(tg)[source]

Check destination_ip incrementation. Count == Increment count. Dot1Q disabled.

test_dst_ip_incrementation_dot1q_disabled_2(tg)[source]

Check destination_ip incrementation. Count = 2*Increment count. Dot1Q disabled.

test_dst_ip_incrementation_dot1q_enabled_1(tg)[source]

Check destination_ip incrementation. Count == Increment count. Dot1Q enabled.

test_dst_ip_incrementation_dot1q_enabled_2(tg)[source]

Check destination_ip incrementation. Count = 2*Increment count. Dot1Q enabled.

test_dst_ipv6_incrementation_dot1q_disabled_1(tg)[source]

Check DST IPv6 incrementation. Count == Increment count. Dot1Q disabled.

test_dst_ipv6_incrementation_dot1q_disabled_2(tg)[source]

Check DST IPv6 incrementation. Count = 2*Increment count. Dot1Q disabled.

test_dst_ipv6_incrementation_dot1q_enabled_1(tg)[source]

Check DST IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_dst_ipv6_incrementation_dot1q_enabled_2(tg)[source]

Check DST IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_dst_udp_incrementation_dot1q_disabled_1(tg)[source]

Check destination_udp incrementation. Count == Increment count. Dot1Q disabled.

test_dst_udp_incrementation_dot1q_disabled_2(tg)[source]

Check destination_udp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_dst_udp_incrementation_dot1q_enabled(tg)[source]

Check destination_udp incrementation. Count == Increment count. Dot1Q enabled.

test_dstmac_filter(tg)[source]

Check dstMac filter.

test_ether_incrementation_dot1q_disabled_1(tg)[source]

Check ether type incrementation. Count == Increment count. Dot1Q disabled.

test_ether_incrementation_dot1q_disabled_2(tg)[source]

Check ip protocol incrementation. Count = 2*Increment count. Dot1Q disabled.

test_exact_packets_delivery(tg)[source]

Verify that send stream send exact packets count.

test_flow_label_dst_ipv6_incrementation(tg)[source]

Check Flow Label and DST IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_flow_label_ipv6_incrementation_dot1q_disabled_1(tg)[source]

Check Flow Label IPv6 incrementation. Count == Increment count. Dot1Q disabled.

test_flow_label_ipv6_incrementation_dot1q_disabled_2(tg)[source]

Check Flow Label incrementation. Count = 2*Increment count. Dot1Q disabled.

test_flow_label_ipv6_incrementation_dot1q_enabled(tg)[source]

Check Flow Label IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_flow_label_src_ipv6_incrementation(tg)[source]

Check Flow Label with SRC IPv6 incrementation. Count = 2*Increment count. Dot1Q disabled.

test_get_rate_stat(tg)[source]

Check transmit rate reading.

test_icmp_custom_filter(tg)[source]

Check ICMP filter.

test_icmp_filter(tg)[source]

Check ICMP filter.

test_incrementation_negative_1(tg)[source]

Verify that method set_stream returns Error message when layer is not defined in packet(1).

test_incrementation_negative_2(tg)[source]

Verify that method set_stream returns Error message when when layer is not defined in packet(2).

test_incremented_streams(tg)[source]

Send incremented streams.

test_ip_custom_filter(tg)[source]

Check IP filter.

test_ip_dip_and_sip_increment_udf_dependant(tg)[source]

Check ip dip and sip_increment incrementation. Dip increment dependant from sip increment.

test_ip_dscp_and_sip_increment_dot1q_disabled_1(tg)[source]

Check ip dscp and sip_increment incrementation. Count == Increment count. Dot1Q disabled.

test_ip_dscp_and_sip_increment_dot1q_disabled_2(tg)[source]

Check ip dscp and sip_increment incrementation. Count == Increment count. Dot1Q disabled.

test_ip_dscp_dip_sip_increment_udf_dependant(tg)[source]

Check ip dscp, dip and sip_increment incrementation. Dependant increments.

test_ip_dscp_dip_sip_increment_udf_one_dependant(tg)[source]

Check ip dscp, dip and sip_increment incrementation. Dependant increments form sip.

test_ip_dscp_incrementation_dot1q_enabled(tg)[source]

Check ip dscp incrementation. Count == Increment count. Dot1Q enabled.

test_ip_filter(tg)[source]

Check IP filter.

test_ip_protocol_and_sip_increment_dot1q_disabled(tg)[source]

Check ip protocol and sip_increment incrementation. Count = 2*Increment count. Dot1Q disabled.

test_ip_protocol_and_sip_increment_dot1q_enabled(tg)[source]

Check ip protocol and sip_increment incrementation. Count == Increment count. Dot1Q enabled.

test_ip_protocol_incrementation_dot1q_disabled(tg)[source]

Check ip protocol incrementation. Count == Increment count. Dot1Q disabled.

test_ip_protocol_incrementation_dot1q_disabled_2(tg)[source]

Check ip protocol incrementation. Count = 2*Increment count. Dot1Q disabled.

test_ip_protocol_incrementation_dot1q_enabled(tg)[source]

Check destination_udp incrementation. Count == Increment count. Dot1Q enabled.

test_lacp_layers(tg)[source]

Verify that LACP packets are built and captured correctly.

test_lldp_build_capture(tg)[source]

Verify that LLDP packets are builded and sniffed correctly.

test_lldp_dcbx(tg)[source]

Verify that DCBX packets are built and captured correctly.

test_lldp_dcbx_app_prio_table(tg)[source]

Verify that DCBX packets with Application Priority Tables are built and captured correctly.

test_lldp_incrementation_continuous_traffic_1(tg)[source]

Check lldp incrementation. Continuous traffic.

test_lldp_incrementation_continuous_traffic_2(tg)[source]

Check lldp incrementation. Continuous traffic.

test_lldp_incrementation_increment_count_1(tg)[source]

Check lldp incrementation. Count == Increment count.

test_lldp_incrementation_increment_count_2(tg)[source]

Check lldp incrementation. Count == 2*Increment count.

test_lldp_sys_capabilities(tg)[source]

Verify that LLDP packets with full System capabilities list are built and captured correctly.

test_lldp_with_padding(tg)[source]

Verify that LLDP packets with with padding are built and captured correctly.

test_multistreams_and_multifaces(tg)[source]

Multiple streams and multiple ifaces.

test_multistreams_and_one(tg)[source]

Multiple streams and one on same iface.

test_multistreams_on_single_iface(tg)[source]

Multiple streams and one iface.

test_next_header_ipv6_incrementation_dot1q_disabled(tg)[source]

Check next header incrementation. Count == Increment count. Dot1Q disabled.

test_next_header_ipv6_incrementation_dot1q_disabled_2(tg)[source]

Check next header incrementation. Count = 2*Increment count. Dot1Q disabled.

test_next_header_ipv6_incrementation_dot1q_enabled(tg)[source]

Check next header IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_not_arp_filter(tg)[source]

Check notARP filter.

test_not_stp_filter(tg)[source]

Check notSTP filter.

test_packet_fragmentation(tg)[source]

Check packet fragmentation.

test_packet_random_size_1(tg)[source]

Check packet random size setting. Count=1.

test_packet_random_size_2(tg)[source]

Check packet random size setting. Count=5.

test_packet_size_decrementing(tg)[source]

Check packet size decrementing. Count=9, decrement count=9.

test_packet_size_incrementing_1(tg)[source]

Check packet size incrementing. Count=1, increment count=5.

test_packet_size_incrementing_2(tg)[source]

Check packet size incrementing. Count=5, increment count=5.

test_packet_with_ipoption(tg)[source]

Test building packet with IPOption.

test_pause_frames_0001(tg)[source]

Verify that MAC Control Pause frames with opcode 0x0001 are builded and sniffed correctly.

test_pause_frames_0101(tg)[source]

Verify that MAC Control Pause frames with opcode 0x0101 are builded and sniffed correctly.

test_pause_frames_ffff(tg)[source]

Verify that MAC Control Pause frames with unknown are builded and sniffed correctly.

test_pproc_packet_dictionary(tg)[source]

Check packet dictionary. Fragsize is None.

test_pproc_packet_fragmentation_1(tg)[source]

Check packet fragmentation.

test_pproc_packet_fragmentation_2(tg)[source]

Check packet fragmentation. fragsize is None.

test_qinq_packets_sniffer(tg)[source]

Check QinQ packet send.

test_qos_iptos_stat(tg)[source]

Check Ixia QoS IP TOS stat reading.

test_qos_vlan_stat(tg)[source]

Check Ixia QoS vlan stat reading.

test_sa_incrementation_1(tg)[source]

Check SA incrementation. Count == Increment count.

test_sa_incrementation_2(tg)[source]

Check SA incrementation. Count > Increment count.

test_sa_incrementation_and_packet_fragmentation(tg)[source]

Check SA incrementation + packet fragmentation. Count == Increment count.

test_send_several_streams(tg)[source]

Send several streams.

test_send_sniff_max_min_packets(tg, padding_size)[source]

Verify sending and sniffing of packets with minimal and maximal size.

test_send_stream_several_times(tg)[source]

Send stream several times and check statistics.

test_single_packet(tg)[source]

Single packet.

test_single_stream(tg)[source]

Single stream.

test_sniffed_packets_timestamp(tg)[source]

Check sniffed packets timestamp.

test_sniffing_negative(tg)[source]

Sniff for one packet, but sniff nothing.

test_src_and_dst_ipv6_incrementation_dot1q_disabled(tg)[source]

Check SRC and DST IPv6 incrementation. Count == Increment count. Dot1Q disabled.

test_src_and_dst_ipv6_incrementation_dot1q_enabled(tg)[source]

Check SRC and DST IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_src_ip_incrementation_dot1q_disabled_1(tg)[source]

Check source_ip incrementation. Count == Increment count. Dot1Q disabled.

test_src_ip_incrementation_dot1q_disabled_2(tg)[source]

Check source_ip incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_ip_incrementation_dot1q_enabled_1(tg)[source]

Check source_ip incrementation. Count == Increment count. Dot1Q enabled.

test_src_ip_incrementation_dot1q_enabled_2(tg)[source]

Check source_ip incrementation. Count = 2*Increment count. Dot1Q enabled.

test_src_ipv6_incrementation_dot1q_disabled_1(tg)[source]

Check SRC IPv6 incrementation. Count == Increment count. Dot1Q disabled.

test_src_ipv6_incrementation_dot1q_disabled_2(tg)[source]

Check SRC IPv6 incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_ipv6_incrementation_dot1q_enabled_1(tg)[source]

Check SRC IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_src_ipv6_incrementation_dot1q_enabled_2(tg)[source]

Check SRC IPv6 incrementation. Count > Increment count. Dot1Q enabled.

test_src_tcp_and_dst_tcp_incrementation_dot1q_disabled_1(tg)[source]

Check source_tcp and destination_tcp incrementation. Count == Increment count. Dot1Q disabled.

test_src_tcp_and_dst_tcp_incrementation_dot1q_disabled_2(tg)[source]

Check source_tcp and destination_tcp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_tcp_and_dst_tcp_incrementation_dot1q_enabled(tg)[source]

Check source_tcp and destination_tcp incrementation. Count == Increment count. Dot1Q enabled.

test_src_tcp_incrementation_dot1q_disabled_1(tg)[source]

Check source_tcp incrementation. Count == Increment count. Dot1Q disabled.

test_src_tcp_incrementation_dot1q_disabled_2(tg)[source]

Check source_tcp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_tcp_incrementation_dot1q_enabled(tg)[source]

Check source_tcp incrementation. Count == Increment count. Dot1Q enabled.

test_src_udp_and_dst_udp_incrementation_dot1q_disabled_1(tg)[source]

Check source_udp and destination_udp incrementation. Count == Increment count. Dot1Q disabled.

test_src_udp_and_dst_udp_incrementation_dot1q_disabled_2(tg)[source]

Check source_udp and destination_udp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_udp_and_dst_udp_incrementation_dot1q_enabled(tg)[source]

Check source_udp and destination_udp incrementation. Count == Increment count. Dot1Q enabled.

test_src_udp_incrementation_dot1q_disabled_1(tg)[source]

Check source_udp incrementation. Count == Increment count. Dot1Q disabled.

test_src_udp_incrementation_dot1q_disabled_2(tg)[source]

Check source_udp incrementation. Count = 2*Increment count. Dot1Q disabled.

test_src_udp_incrementation_dot1q_enabled(tg)[source]

Check source_udp incrementation. Count == Increment count. Dot1Q enabled.

test_srcmac_and_dstmac_filter(tg)[source]

Check srcMac and dstMac filter.

test_srcmac_and_dstmac_wrong_layer_filter(tg)[source]

Check srcMac and dstMac filter with wrong filter_layer.

test_srcmac_filter(tg)[source]

Check srcMac filter.

test_start_stop_parallel_and_independent_continuous_streams(tg)[source]

Verify parallel and independent streams starts and stops.

test_start_stop_parallel_and_independent_set_quantity_streams(tg)[source]

Verify parallel and independent set quantity of streams.

test_stop_all_streams(tg)[source]

Verify that stop_streams stop all streams by default.

test_stop_sniffing(tg)[source]

Start continuous stream and stop sniffing.

test_stp_custom_filter(tg)[source]

Check STP filter.

test_stp_filter(tg)[source]

Check STP filter.

test_stream(tg)[source]

Verify that send stream send exact packets count.

test_streams_corruption_1(tg)[source]

Verify that set_stream does not corrupt already started streams.

test_streams_corruption_2(tg)[source]

Verify that set_stream does not corrupt already started streams.

test_tcp_custom_filter(tg)[source]

Check TCP filter.

test_tcp_filter(tg)[source]

Check TCP filter.

test_traffic_class_ipv6_incrementation_dot1q_disabled(tg)[source]

Check traffic class incrementation. Count == Increment count. Dot1Q disabled.

test_traffic_class_ipv6_incrementation_dot1q_disabled_2(tg)[source]

Check traffic class incrementation. Count = 2*Increment count. Dot1Q disabled.

test_traffic_class_ipv6_incrementation_dot1q_enabled(tg)[source]

Check traffic class IPv6 incrementation. Count == Increment count. Dot1Q enabled.

test_udp_custom_filter(tg)[source]

Check UDP filter.

test_udp_filter(tg)[source]

Check UDP filter.

test_vlan_incrementation_increment_count_1(tg)[source]

Check vlan incrementation. Count == Increment count.

test_vlan_incrementation_increment_count_2(tg)[source]

Check vlan incrementation. Count == 2*Increment count.

test_xstp_build_capture(tg)[source]

Check stp/rstp/mstp build and detection.

verify_packets_data(initial_packet_def, received_packet_def)[source]

Check 2 packet definitions

unittests.traffic_generator.test_trextg

test_trextg.py

TRex traffic generator’s unittests

Notes

To run TRex unittests:
  1. Install TRex client package
  2. Configure and start TRex server
  3. Specify IP address and ports in the following variables: TREX_HLT_CONFIG, TREX_CONFIG
class unittests.traffic_generator.test_trextg.TestTrexHLTTg[source]

Bases: object

pytestmark = [Mark(name='skipif', args=(False,), kwargs={'reason': 'Need to install TRex client package'})]
test_simple_udp(trex_hlt)[source]

Send bidirectional UDP stream.

class unittests.traffic_generator.test_trextg.TestTrexTg[source]

Bases: object

packet_definition = ({'Ether': {'src': '00:00:00:00:00:02', 'dst': 'ff:ff:ff:ff:ff:ff'}}, {'IP': {'src': '10.1.1.1', 'dst': '20.1.1.1'}}, {'UDP': {'dport': 50, 'sport': 10}})
packet_definition_tcp = ({'Ether': {'src': '00:00:00:00:00:02', 'dst': 'ff:ff:ff:ff:ff:ff'}}, {'IP': {'src': '10.1.1.1', 'dst': '20.1.1.1'}}, {'TCP': {'dport': 50, 'sport': 10}})
pytestmark = [Mark(name='skipif', args=(False,), kwargs={'reason': 'Need to install TRex client package'})]
test_all_supported_increments_simultaneously(trex)[source]

Set stream with all supported increments simultaneously and send it

Notes

Two TRex interfaces should be connected to each other

test_clear_statistics(trex)[source]

Clear interface statistics.

test_increment_dst_ip(trex)[source]

Set stream with destination ip increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_required_size_1(trex)[source]

Set stream with ‘required_size’ increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_required_size_in_loop(trex)[source]

Set stream with increment ‘required_size’ and verify that size is wrapped back to min value.

Notes

Two TRex interfaces should be connected to each other

test_increment_src_ip(trex)[source]

Set stream with source ip increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_tcp_dst_port(trex)[source]

Set stream with TCP destination port increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_tcp_src_port(trex)[source]

Set stream with TCP source port increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_udp_dst_port(trex)[source]

Set stream with UDP destination port increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_increment_udp_src_port(trex)[source]

Set stream with UDP source port increment and send it.

Notes

Two TRex interfaces should be connected to each other

test_random_required_size(trex)[source]

Set stream with random ‘required_size’ and send it.

Notes

Two TRex interfaces should be connected to each other

test_send_2_streams_on_same_interface_trex(trex)[source]

Send 2 streams using send_stream method on same interface.

test_send_2_streams_trex(trex)[source]

Send 2 streams using send_stream method on different interfaces.

test_single_stream_trex(trex)[source]

Send single stream using send_stream method.

test_single_stream_with_packet_interval_trex(trex)[source]

Send single stream with packets interval.

test_start_2_continuous_on_same_interface_streams_trex(trex)[source]

Send 2 continuous streams using start_streams method on same interface.

test_start_2_continuous_streams_trex(trex)[source]

Send 2 continuous streams using start_streams method on different interfaces.

test_start_2_streams_on_same_interface_trex(trex)[source]

Send 2 streams using start_streams method on same interface.

test_start_2_streams_trex(trex)[source]

Send 2 streams using start_streams method on different interfaces.

unittests.traffic_generator.test_trextg.trex(request)[source]
unittests.traffic_generator.test_trextg.trex_hlt(request)[source]