"""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
+ - 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
- 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
+ - 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**
- 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
+ - 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**
- 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
+ - 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**
cls.flows = dict()
for i in range(len(cls.pg_interfaces)):
delta = 1 if i % 2 == 0 else -1
- cls.flows[cls.pg_interfaces[i]] = [cls.pg_interfaces[i + delta]]
+ cls.flows[cls.pg_interfaces[i]] =\
+ [cls.pg_interfaces[i + delta]]
# Mapping between packet-generator index and lists of test hosts
cls.hosts_by_pg_idx = dict()
super(TestL2xcMultiInst, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2xcMultiInst, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
Show various debug prints after each test.
"""
super(TestL2xcMultiInst, self).tearDown()
- if not self.vpp_dead:
- self.logger.info(self.vapi.ppcli("show l2patch"))
+
+ def show_commands_at_teardown(self):
+ self.logger.info(self.vapi.ppcli("show l2patch"))
@classmethod
def create_hosts(cls, count):
last_info[i.sw_if_index] = None
dst_sw_if_index = pg_if.sw_if_index
for packet in capture:
- payload_info = self.payload_to_info(str(packet[Raw]))
+ payload_info = self.payload_to_info(packet[Raw])
try:
ip = packet[IP]
udp = packet[UDP]