2.61. test_l2xc_multi_instance module¶
L2XC Multi-instance Test Case HLD:
- NOTES:
higher number (more than 15) of pg-l2 interfaces causes problems => only 14 pg-l2 interfaces and 10 cross-connects are tested
jumbo packets in configuration with 14 l2-pg interfaces leads to problems too
- config 1
add 14 pg-l2 interfaces
add 10 cross-connects (two cross-connects per pair of l2-pg interfaces)
- test 1
send L2 MAC frames between all pairs of pg-l2 interfaces
- verify 1
all packets received correctly in case of cross-connected l2-pg interfaces
no packet received in case of not cross-connected l2-pg interfaces
- config 2
delete 4 cross-connects
- test 2
send L2 MAC frames between all pairs of pg-l2 interfaces
- verify 2
all packets received correctly in case of cross-connected l2-pg interfaces
no packet received in case of not cross-connected l2-pg interfaces
- config 3
add new 4 cross-connects
- test 3
send L2 MAC frames between all pairs of pg-l2 interfaces
- verify 3
all packets received correctly in case of cross-connected l2-pg interfaces
no packet received in case of not cross-connected l2-pg interfaces
- config 4
delete 10 cross-connects
- test 4
send L2 MAC frames between all pairs of pg-l2 interfaces
- verify 4
no packet received on all of l2-pg interfaces (no cross-connect created)
-
class
test_l2xc_multi_instance.
TestL2xcMultiInst
(methodName='runTest')¶ Bases:
framework.VppTestCase
L2XC Multi-instance Test Case
-
classmethod
create_hosts
(count)¶ Create required number of host MAC addresses and distribute them among interfaces. Create host IPv4 address for every host MAC address.
- Parameters
count (int) – Number of hosts to create MAC/IPv4 addresses for.
-
create_stream
(src_if, packet_sizes)¶ Create input packet stream for defined interface using hosts list.
- Parameters
src_if (object) – Interface to create packet stream for.
packet_sizes (list) – List of required packet sizes.
- Returns
Stream of packets.
-
create_xconnects
(count, start=0)¶ Create required number of cross-connects (always two cross-connects per pair of packet-generator interfaces).
- Parameters
count (int) – Number of cross-connects to be created.
start (int) – Starting index of packet-generator interfaces. (Default value = 0)
-
delete_xconnects
(count, start=0)¶ Delete required number of cross-connects (always two cross-connects per pair of packet-generator interfaces).
- Parameters
count (int) – Number of cross-connects to be deleted.
start (int) – Starting index of packet-generator interfaces. (Default value = 0)
-
run_verify_test
()¶ - Create packet streams for all configured l2-pg interfaces, send all prepared packet streams and verify that:
all packets received correctly on all pg-l2 interfaces assigned to cross-connects
no packet received on all pg-l2 interfaces not assigned to cross-connects
- Raises
RuntimeError – if no packet captured on l2-pg interface assigned to the cross-connect or if any packet is captured on l2-pg interface not assigned to the cross-connect.
-
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.
-
tearDown
()¶ Show various debug prints after each test.
-
classmethod
tearDownClass
()¶ Perform final cleanup after running all tests in this test-case
-
test_l2xc_inst_01
()¶ L2XC Multi-instance test 1 - create 10 cross-connects
-
test_l2xc_inst_02
()¶ L2XC Multi-instance test 2 - delete 4 cross-connects
-
test_l2xc_inst_03
()¶ L2BD Multi-instance 3 - add new 4 cross-connects
-
test_l2xc_inst_04
()¶ L2XC Multi-instance test 4 - delete 10 cross-connects
-
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