2.37. test_ip4_vrf_multi_instance module¶
IP4 VRF Multi-instance Test Case HLD:
- NOTES:
- higher number of pg-ip4 interfaces causes problems => only 15 pg-ip4 interfaces in 5 VRFs are tested
- jumbo packets in configuration with 15 pg-ip4 interfaces leads to problems too
- Reset of FIB table / VRF does not remove routes from IP FIB (see Jira ticket https://jira.fd.io/browse/VPP-560) so checks of reset VRF tables are skipped in tests 2, 3 and 4
- config 1
- add 15 pg-ip4 interfaces
- configure 5 hosts per pg-ip4 interface
- configure 4 VRFs
- add 3 pg-ip4 interfaces per VRF
- test 1
- send IP4 packets between all pg-ip4 interfaces in all VRF groups
- verify 1
- check VRF data by parsing output of ip_fib_dump API command
- all packets received correctly in case of pg-ip4 interfaces in VRF
- no packet received in case of pg-ip4 interfaces not in VRF
- config 2
- delete 2 VRFs
- test 2
- send IP4 packets between all pg-ip4 interfaces in all VRF groups
- verify 2
- check VRF data by parsing output of ip_fib_dump API command
- all packets received correctly in case of pg-ip4 interfaces in VRF
- no packet received in case of pg-ip4 interfaces not in VRF
- config 3
- add 1 of deleted VRFs and 1 new VRF
- test 3
- send IP4 packets between all pg-ip4 interfaces in all VRF groups
- verify 3
- check VRF data by parsing output of ip_fib_dump API command
- all packets received correctly in case of pg-ip4 interfaces in VRF
- no packet received in case of pg-ip4 interfaces not in VRF
- config 4
- delete all VRFs (i.e. no VRF except VRF=0 created)
- test 4
- send IP4 packets between all pg-ip4 interfaces in all VRF groups
- verify 4
- check VRF data by parsing output of ip_fib_dump API command
- all packets received correctly in case of pg-ip4 interfaces in VRF
- no packet received in case of pg-ip4 interfaces not in VRF
-
class
test_ip4_vrf_multi_instance.
TestIp4VrfMultiInst
(methodName='runTest')¶ Bases:
framework.VppTestCase
IP4 VRF Multi-instance Test Case
-
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_vrf_and_assign_interfaces
(count, start=1)¶ Create required number of FIB tables / VRFs, put 3 l2-pg interfaces to every FIB table / VRF.
Parameters: - count (int) – Number of FIB tables / VRFs to be created.
- start (int) – Starting number of the FIB table / VRF ID. (Default value = 1)
-
delete_vrf
(vrf_id)¶ Delete required FIB table / VRF.
Parameters: vrf_id (int) – The FIB table / VRF ID to be deleted.
-
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 bridge domains
- no packet received on all pg-l2 interfaces not assigned to bridge domains
Raises: RuntimeError – If no packet captured on l2-pg interface assigned to the bridge domain or if any packet is captured on l2-pg interface not assigned to the bridge domain.
-
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.
-
test_ip4_vrf_01
()¶ IP4 VRF Multi-instance test 1 - create 5 BDs
-
test_ip4_vrf_02
()¶ IP4 VRF Multi-instance test 2 - delete 2 VRFs
-
test_ip4_vrf_03
()¶ IP4 VRF Multi-instance 3 - add 2 VRFs
-
test_ip4_vrf_04
()¶ IP4 VRF Multi-instance test 4 - delete 4 VRFs
-
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.
-
verify_vrf
(vrf_id)¶ Check if the FIB table / VRF ID is configured.
Parameters: vrf_id (int) – The FIB table / VRF ID to be verified. Returns: 1 if the FIB table / VRF ID is configured, otherwise return 0.
-
-
test_ip4_vrf_multi_instance.
is_ipv4_misc
(p)¶ Is packet one of uninteresting IPv4 broadcasts?