2.50. test_l2bd module¶
-
class
test_l2bd.
TestL2bd
(methodName='runTest')¶ Bases:
framework.VppTestCase
L2BD Test Case
-
classmethod
create_hosts_and_learn
(count)¶ Create required number of host MAC addresses and distribute them among interfaces. Create host IPv4 address for every host MAC address. Create L2 MAC packet stream with host MAC addresses per interface to let the bridge domain learn these MAC addresses.
- Parameters
count – Integer number of hosts to create MAC/IPv4 addresses for.
-
create_stream
(src_if, packet_sizes, packets_per_burst)¶ Create input packet stream for defined interface.
- Parameters
src_if (object) – Interface to create packet stream for.
packet_sizes (list) – List of required packet sizes.
packets_per_burst (int) – Number of packets in burst.
- Returns
Stream of packets.
-
run_l2bd_test
(pkts_per_burst)¶ L2BD MAC learning test
-
setUp
()¶ Clear trace and packet infos before running each test.
-
classmethod
setUpClass
()¶ Perform standard class setup (defined by class method setUpClass in class VppTestCase) before running the test case, set test case related variables and configure VPP.
- Variables
bd_id (int) – Bridge domain ID.
mac_entries_count (int) – Number of MAC entries for bridge-domain to learn.
dot1q_tag (int) – VLAN tag for dot1q sub-interface.
dot1ad_sub_id (int) – SubID of dot1ad sub-interface.
dot1ad_outer_tag (int) – VLAN S-tag for dot1ad sub-interface.
dot1ad_inner_tag (int) – VLAN C-tag for dot1ad sub-interface.
sl_pkts_per_burst (int) – Number of packets in burst for single-loop test.
dl_pkts_per_burst (int) – Number of packets in burst for dual-loop test.
-
tearDown
()¶ Show various debug prints after each test.
-
classmethod
tearDownClass
()¶ Perform final cleanup after running all tests in this test-case
-
test_l2bd_dl
()¶ L2BD MAC learning dual-loop test
- Test scenario:
- 1.config
MAC learning enabled learn 100 MAC entries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version)
- 2.sending l2 eth pkts between 3 interface
64B, 512B, 1518B, 9200B (ether_size) burst of 257 pkts per interface
-
test_l2bd_sl
()¶ L2BD MAC learning single-loop test
- Test scenario:
- 1.config
MAC learning enabled learn 100 MAC entries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version)
- 2.sending l2 eth pkts between 3 interface
64B, 512B, 1518B, 9200B (ether_size) burst of 2 pkts per interface
-
verify_capture
(pg_if, capture)¶ Verify captured input packet stream for defined interface.
- Parameters
pg_if (object) – Interface to verify captured packet stream for.
capture (list) – Captured packet stream.
-
classmethod