2.43. test_ip6_vrf_multi_instance module

IP6 VRF Multi-instance Test Case HLD:

NOTES:
  • higher number of pg-ip6 interfaces causes problems => only 15 pg-ip6 interfaces in 5 VRFs are tested
  • jumbo packets in configuration with 15 pg-ip6 interfaces leads to problems too
config 1
  • add 15 pg-ip6 interfaces
  • configure 5 hosts per pg-ip6 interface
  • configure 4 VRFs
  • add 3 pg-ip6 interfaces per VRF
test 1
  • send IP6 packets between all pg-ip6 interfaces in all VRF groups
verify 1
  • check VRF data by parsing output of ip6_fib_dump API command
  • all packets received correctly in case of pg-ip6 interfaces in the same

VRF - no packet received in case of pg-ip6 interfaces not in VRF - no packet received in case of pg-ip6 interfaces in different VRFs

config 2
  • reset 2 VRFs
test 2
  • send IP6 packets between all pg-ip6 interfaces in all VRF groups
verify 2
  • check VRF data by parsing output of ip6_fib_dump API command
  • all packets received correctly in case of pg-ip6 interfaces in the same

VRF - no packet received in case of pg-ip6 interfaces not in VRF - no packet received in case of pg-ip6 interfaces in different VRFs

config 3
  • add 1 of reset VRFs and 1 new VRF
test 3
  • send IP6 packets between all pg-ip6 interfaces in all VRF groups
verify 3
  • check VRF data by parsing output of ip6_fib_dump API command
  • all packets received correctly in case of pg-ip6 interfaces in the same

VRF - no packet received in case of pg-ip6 interfaces not in VRF - no packet received in case of pg-ip6 interfaces in different VRFs

config 4
  • reset all VRFs (i.e. no VRF except VRF=0 created)
test 4
  • send IP6 packets between all pg-ip6 interfaces in all VRF groups
verify 4
  • check VRF data by parsing output of ip6_fib_dump API command
  • all packets received correctly in case of pg-ip6 interfaces in the same

VRF - no packet received in case of pg-ip6 interfaces not in VRF - no packet received in case of pg-ip6 interfaces in different VRFs

class test_ip6_vrf_multi_instance.TestIP6VrfMultiInst(methodName='runTest')

Bases: framework.VppTestCase

IP6 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_stream_crosswise_vrf(src_if, vrf_id, packet_sizes)

Create input packet stream for negative test for leaking across different VRFs for defined interface using hosts list.

Parameters:
  • src_if (object) – Interface to create packet stream for.
  • vrf_id (int) – The FIB table / VRF ID where src_if is assigned.
  • 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 pg-ip6 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)
reset_vrf_and_remove_from_vrf_list(vrf_id)

Reset required FIB table / VRF and remove it from VRF list.

Parameters:vrf_id (int) – The FIB table / VRF ID to be reset.
run_crosswise_vrf_test()

Create packet streams for every pg-ip6 interface in VRF towards all pg-ip6 interfaces in other VRFs, send all prepared packet streams and verify that:

  • no packet received on all configured pg-ip6 interfaces
Raises:RuntimeError – If any packet is captured on any pg-ip6 interface.
run_verify_test()
Create packet streams for all configured pg interfaces, send all prepared packet streams and verify that:
  • all packets received correctly on all pg-ip6 interfaces assigned to VRFs
  • no packet received on all pg-ip6 interfaces not assigned to VRFs
Raises:RuntimeError – If no packet captured on pg-ip6 interface assigned to VRF or if any packet is captured on pg-ip6 interface not assigned to VRF.
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_ip6_vrf_01()

IP6 VRF Multi-instance test 1 - create 4 VRFs

test_ip6_vrf_02()

IP6 VRF Multi-instance test 2 - reset 2 VRFs

test_ip6_vrf_03()

IP6 VRF Multi-instance 3 - add 2 VRFs

test_ip6_vrf_04()

IP6 VRF Multi-instance test 4 - reset 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_ip6_vrf_multi_instance.is_ipv6_misc_ext(p)

Is packet one of uninteresting IPv6 broadcasts (extended to filter out ICMPv6 Neighbor Discovery - Neighbor Advertisement packets too)?