test: l2bd instance multi-context correction

- small correction of docstrings
- fix of create_pg_interface

Change-Id: I1958bd5ddaddaa2f7e6cbb18b0076e59e86d1e68
Signed-off-by: Jan Gelety <jgelety@cisco.com>
This commit is contained in:
Jan
2016-12-05 23:29:17 +01:00
parent cf3658da71
commit 65209ed18c
2 changed files with 22 additions and 28 deletions

View File

@ -4,8 +4,8 @@
**NOTES:** **NOTES:**
- higher number of pg-l2 interfaces causes problems => only 15 pg-l2 \ - higher number of pg-l2 interfaces causes problems => only 15 pg-l2 \
interfaces in 5 bridge domains are tested interfaces in 5 bridge domains are tested
- more then 1 host per pg-l2 interface in configuration with 15 l2-pg \ - jumbo packets in configuration with 14 l2-pg interfaces leads to \
interfaces leads to problems too problems too
**config 1** **config 1**
- add 15 pg-l2 interfaces - add 15 pg-l2 interfaces
@ -105,10 +105,10 @@ class TestL2bdMultiInst(VppTestCase):
cls.hosts_by_pg_idx[pg_if.sw_if_index] = [] cls.hosts_by_pg_idx[pg_if.sw_if_index] = []
# Create test host entries # Create test host entries
cls.create_hosts(15) cls.create_hosts(75)
# Packet sizes # Packet sizes - jumbo packet (9018 bytes) skipped
cls.pg_if_packet_sizes = [64, 512, 1518, 9018] cls.pg_if_packet_sizes = [64, 512, 1518]
# Set up all interfaces # Set up all interfaces
for i in cls.pg_interfaces: for i in cls.pg_interfaces:
@ -171,7 +171,7 @@ class TestL2bdMultiInst(VppTestCase):
hosts.append(host) hosts.append(host)
def create_bd_and_mac_learn(self, count, start=1): def create_bd_and_mac_learn(self, count, start=1):
"""" """
Create required number of bridge domains with MAC learning enabled, put Create required number of bridge domains with MAC learning enabled, put
3 l2-pg interfaces to every bridge domain and send MAC learning packets. 3 l2-pg interfaces to every bridge domain and send MAC learning packets.
@ -206,7 +206,7 @@ class TestL2bdMultiInst(VppTestCase):
self.logger.info(self.vapi.ppcli("show l2fib")) self.logger.info(self.vapi.ppcli("show l2fib"))
def delete_bd(self, count, start=1): def delete_bd(self, count, start=1):
"""" """
Delete required number of bridge domains. Delete required number of bridge domains.
:param int count: Number of bridge domains to be created. :param int count: Number of bridge domains to be created.
@ -306,13 +306,9 @@ class TestL2bdMultiInst(VppTestCase):
Enable/disable defined feature(s) of the bridge domain. Enable/disable defined feature(s) of the bridge domain.
:param int bd_id: Bridge domain ID. :param int bd_id: Bridge domain ID.
:param list args: List of feature/status pairs. Allowed features: :param list args: List of feature/status pairs. Allowed features: \
- learn, learn, forward, flood, uu_flood and arp_term. Status False means \
- forward, disable, status True means enable the feature.
- flood,
- uu_flood and
- arp_term
Status False means disable, status True means enable the feature.
:raise: ValueError in case of unknown feature in the input. :raise: ValueError in case of unknown feature in the input.
""" """
for flag in args: for flag in args:
@ -338,13 +334,9 @@ class TestL2bdMultiInst(VppTestCase):
of listed features. of listed features.
:param int bd_id: Bridge domain ID. :param int bd_id: Bridge domain ID.
:param list args: List of feature/status pairs. Allowed features: :param list args: List of feature/status pairs. Allowed features: \
- learn, learn, forward, flood, uu_flood and arp_term. Status False means \
- forward, disable, status True means enable the feature.
- flood,
- uu_flood and
- arp_term
Status False means disable, status True means enable the feature.
:return: 1 if bridge domain is configured, otherwise return 0. :return: 1 if bridge domain is configured, otherwise return 0.
:raise: ValueError in case of unknown feature in the input. :raise: ValueError in case of unknown feature in the input.
""" """
@ -376,14 +368,14 @@ class TestL2bdMultiInst(VppTestCase):
""" """
Create packet streams for all configured l2-pg interfaces, send all Create packet streams for all configured l2-pg interfaces, send all
prepared packet streams and verify that: prepared packet streams and verify that:
- all packets received correctly on all pg-l2 interfaces assigned to - all packets received correctly on all pg-l2 interfaces assigned \
bridge domains to bridge domains
- no packet received on all pg-l2 interfaces not assigned to bridge - no packet received on all pg-l2 interfaces not assigned to \
domains bridge domains
:raise: RuntimeError if no packet captured on l2-pg interface assigned :raise: RuntimeError if no packet captured on l2-pg interface assigned \
to the bridge domain or if any packet is captured on l2-pg interface to the bridge domain or if any packet is captured on l2-pg interface \
not assigned to the bridge domain. not assigned to the bridge domain.
""" """
# Test # Test
# Create incoming packet streams for packet-generator interfaces # Create incoming packet streams for packet-generator interfaces

View File

@ -1,6 +1,8 @@
from abc import abstractmethod, ABCMeta from abc import abstractmethod, ABCMeta
import socket import socket
from util import Host
class VppInterface(object): class VppInterface(object):
"""Generic VPP interface.""" """Generic VPP interface."""