2.26. test_ip4_irb module

IRB Test Case HLD:

config
  • L2 MAC learning enabled in l2bd
  • 2 routed interfaces untagged, bvi (Bridge Virtual Interface)
  • 2 bridged interfaces in l2bd with bvi
test
  • sending ip4 eth pkts between routed interfaces
    • 2 routed interfaces
    • 2 bridged interfaces
  • 64B, 512B, 1518B, 9200B (ether_size)
  • burst of pkts per interface
    • 257pkts per burst
    • routed pkts hitting different FIB entries
    • bridged pkts hitting different MAC entries
verify
  • all packets received correctly
class test_ip4_irb.TestIpIrb(methodName='runTest')

Bases: framework.VppTestCase

IRB Test Case

create_stream(src_ip_if, dst_ip_if, packet_sizes)
create_stream_l2_to_ip(src_l2_if, src_ip_if, dst_ip_if, packet_sizes)
classmethod setUpClass()
  1. Create BD with MAC learning enabled and put interfaces to this BD.
  2. Configure IPv4 addresses on loopback interface and routed interface.
  3. Configure MAC address binding to IPv4 neighbors on loop0.
  4. Configure MAC address on pg2.
  5. Loopback BVI interface has remote hosts, one half of hosts are behind pg0 second behind pg1.
tearDown()

Run standard test teardown and log show l2patch, show l2fib verbose,``show bridge-domain <bd_id> detail``, show ip arp.

test_ip4_irb_1()

IPv4 IRB test 1

Test scenario:
  • ip traffic from pg2 interface must ends in both pg0 and pg1
  • arp entry present in loop0 interface for destination IP
  • no l2 entree configured, pg0 and pg1 are same
test_ip4_irb_2()

IPv4 IRB test 2

Test scenario:
  • ip traffic from pg0 and pg1 ends on pg2
verify_capture(dst_ip_if, src_ip_if, capture)
verify_capture_l2_to_ip(dst_ip_if, src_ip_if, capture)