unittests.common¶
common.py
Unittests common functionality
unittests.test_ab_parser¶
test_ab_parser.py
unittests.test_clicmd¶
unittests.test_clissh¶
unittests.test_common3¶
unittests.test_dependencies_core¶
test_dependencies_core.py
Unittests for dependencies core functions
-
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_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_dev_linux_host¶
unittests.test_fixtures¶
unittests.test_getports¶
test_getports.py
Unittests for getting ports functions
-
class
unittests.test_getports.FakeOpts[source]¶ Bases:
objectFakeOpts 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_helpers¶
test_helpers.py
Unittests for helpers functions
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-
RAW_ETHTHOOL_NO_LINK_OUTPUT= 'Settings for sw0p5:\n\tSupported ports: [ FIBRE ]\n\tSupported link modes: Not reported\n\tSupported pause frame use: No\n\tSupports auto-negotiation: No\n\tAdvertised link modes: Not reported\n\tAdvertised pause frame use: No\n\tAdvertised auto-negotiation: No\n\tSpeed: 40000Mb/s\n\tDuplex: Full\n\tPort: FIBRE\n\tPHYAD: 0\n\tTransceiver: internal\n\tAuto-negotiation: off\n\tLink detected: no\n'¶
-
RAW_IPLINK_DETAIL_OUTPUT= '1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default \\ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0\n2: virtual: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\\ link/ether 52:54:00:e6:fa:6f brd ff:ff:ff:ff:ff:ff promiscuity 0\n3: public: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UP mode DEFAULT group default qlen 1000\\ link/ether 52:54:00:42:60:3b brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch_slave\n4: mgmt: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\\ link/ether 52:54:00:12:56:6a brd ff:ff:ff:ff:ff:ff promiscuity 0\n5: inter: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\\ link/ether 52:54:00:cb:52:a3 brd ff:ff:ff:ff:ff:ff promiscuity 0\n6: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default \\ link/ether 52:54:00:7a:59:81 brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ bridge\n7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 500\\ link/ether 52:54:00:7a:59:81 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ tun \\ bridge_slave\n8: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether a2:d0:01:41:43:7e brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n9: br-ex: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether e2:c9:ec:dc:97:46 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n10: qg-37eee8e0-67: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether 9a:c3:8b:48:da:ca brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n11: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether ba:78:34:19:4a:47 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n12: qr-96ef1966-8d: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether 1a:ed:21:17:bf:a1 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n13: qr-35aafe49-25: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether 52:cc:5c:d4:4f:29 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n15: br-virtual: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether 66:5c:b0:16:63:46 brd ff:ff:ff:ff:ff:ff promiscuity 1 \\ openvswitch\n'¶
-
RAW_IPLINK_DETAIL_OUTPUT_OLD= '1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default \\ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 \n2: pep8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 15346 qdisc mq state UP mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:b4:14 brd ff:ff:ff:ff:ff:ff promiscuity 1 \n3: pep4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:b4:10 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n4: enp0s20f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:bd:d0 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n5: enp0s20f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:bd:d1 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n6: enp0s20f2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:bd:d2 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n7: enp0s20f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:60:bd:d3 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n8: p1p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\\ link/ether a0:36:9f:5c:ff:fe brd ff:ff:ff:ff:ff:ff promiscuity 0 \n9: sw0p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast portid 00000001 state UP mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n10: sw0p2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000002 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n11: sw0p3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000003 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n12: sw0p4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000004 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n13: sw0p5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1 portid 00000005 state UP mode DEFAULT group default qlen 1000\\ link/ether b2:7c:46:41:6e:3c brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team_slave \n14: sw0p6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1 portid 00000006 state UP mode DEFAULT group default qlen 1000\\ link/ether b2:7c:46:41:6e:3c brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team_slave \n15: sw0p7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team2 portid 00000007 state UP mode DEFAULT group default qlen 1000\\ link/ether 9a:3d:f6:a2:ef:f6 brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team_slave \n16: sw0p8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master 1234 portid 00000008 state UP mode DEFAULT group default qlen 1000\\ link/ether a2:76:22:ff:47:5d brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team_slave \n17: sw0p9: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000009 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n18: sw0p10: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000a state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n19: sw0p11: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000b state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n20: sw0p12: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000c state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n21: sw0p13: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000d state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n22: sw0p14: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000e state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n23: sw0p15: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0000000f state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n24: sw0p16: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000010 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n25: sw0p19: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000013 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n26: sw0p20: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000014 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n27: sw0p21: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000015 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n28: sw0p22: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000016 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n29: sw0p23: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000017 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n30: sw0p24: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000018 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n31: sw0p25: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000019 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n32: sw0p0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 00000000 state DOWN mode DEFAULT group default qlen 1000\\ link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 \n33: team1@NONE: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether b2:7c:46:41:6e:3c brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team addrgenmode eui64 \n34: team2@NONE: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether 9a:3d:f6:a2:ef:f6 brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team addrgenmode eui64 \n35: 1234: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default \\ link/ether a2:76:22:ff:47:5d brd ff:ff:ff:ff:ff:ff promiscuity 0 \\ team addrgenmode eui64 \n'¶
-
RAW_READLINK_OUTPUT= '../../devices/pci0000:00/0000:00:15.0/0000:03:00.0/net/eth0\n'¶
-
unittests.test_loggers¶
test_loggers.py
Unittests for logging functionality in TAF
-
class
unittests.test_loggers.TestLogger[source]¶ Bases:
object-
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_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.
-
unittests.test_pytest_helpers¶
test_pytest_helpers.py
Unittests for helpers functions
-
unittests.test_pytest_helpers.test_get_failure_reason()[source]¶ Check if get_failure_reason(data) is work correct.
-
unittests.test_pytest_helpers.test_get_suite_name()[source]¶ Test of pytest_helpers.get_tcname() function.
unittests.test_pytest_loganalyzer¶
unittests.test_reporting_server¶
test_reporting_server.py
Unittests for reporting server functions
-
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_service_lib¶
test_service_lib.py
SystemD service library unittests
-
class
unittests.test_service_lib.TestSpecificServiceManager(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
unittests.test_staticcross¶
test_staticcross.py
Unittests for static cross functions
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_ui_helpers¶
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
unittests.linux.test_iperf¶
test_iperf.py
IPerfRunner Unittests
unittests.linux.test_parser¶
test_parser.py
Parse tools Unittests
unittests.linux.test_tool_general¶
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_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_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_runxfail_option(testdir)[source]¶ Verify that can rerun test 5 times with mark xfail and option runxfail.
-
unittests.test_plugins.test_multipletg¶
test_multipletg.py
Unittests for pytest_multipletg plugin
-
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_pidchecker¶
test_pidchecker.py
Unittests for pytest_pidchecker.py
-
class
unittests.test_plugins.test_pidchecker.FakeItem(monkeypatch, pidchecker)[source]¶ Bases:
object
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:
objectClass verifies count and timing parameters of test duration.
-
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_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.
-
-
class
unittests.test_plugins.test_tc_duration.TestOptionCountTiming[source]¶ Bases:
objectClass 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_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.
-
unittests.traffic_generator.conftest¶
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_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_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).
-
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_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_proto(tg)[source]¶ Check all fields in incremented packet. IP.proto 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_default_ether_type(tg)[source]¶ Verify that default Ether type for tagged packets is equal to 0x8100.
-
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_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_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_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_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_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_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_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_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_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_sa_incrementation_and_packet_fragmentation(tg)[source]¶ Check SA incrementation + packet fragmentation. Count == Increment count.
-
test_send_sniff_max_min_packets(tg, padding_size)[source]¶ Verify sending and sniffing of packets with minimal and maximal size.
-
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_wrong_layer_filter(tg)[source]¶ Check srcMac and dstMac filter with wrong filter_layer.
-
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_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_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_vlan_incrementation_increment_count_1(tg)[source]¶ Check vlan incrementation. Count == Increment count.
-
unittests.traffic_generator.test_trextg¶
test_trextg.py
TRex traffic generator’s unittests
Notes
- To run TRex unittests:
- Install TRex client package
- Configure and start TRex server
- 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'})]¶
-
-
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_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_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.
-