2.36. test_l2xc module

class test_l2xc.TestL2xc(methodName='runTest')

Bases: framework.VppTestCase

L2XC Test Case

classmethod create_host_lists(count)

Method to create required number of MAC and IPv4 addresses. Create required number of host MAC addresses and distribute them among interfaces. Create host IPv4 address for every host MAC address too.

Parameters:count – Number of hosts to create MAC and 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_l2xc_test(pkts_per_burst)

L2XC test

setUp()
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:
  • hosts_nr (int) – Number of hosts to be created.
  • dl_pkts_per_burst (int) – Number of packets in burst for dual-loop test.
  • sl_pkts_per_burst (int) – Number of packets in burst for single-loop test.
tearDown()

Show various debug prints after each test.

test_l2xc_dl()

L2XC dual-loop test

Test scenario:
  1. config
    2 pairs of 2 interfaces, l2xconnected
  2. sending l2 eth packets between 4 interfaces
    64B, 512B, 1518B, 9018B (ether_size) burst of 257 packets per interface
test_l2xc_sl()

L2XC single-loop test

Test scenario:
  1. config
    2 pairs of 2 interfaces, l2xconnected
  2. sending l2 eth packets between 4 interfaces
    64B, 512B, 1518B, 9018B (ether_size) burst of 2 packets 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.