Revert "Revert "make test: fix broken interfaces""
This reverts commit c8efa29b6f9a91381897b54f1147daf922ed7164.
Change-Id: I1d5c5773d5f86a63073e255336bd9de628e26179
Signed-off-by: Klement Sekera <ksekera@cisco.com>
diff --git a/test/vpp_sub_interface.py b/test/vpp_sub_interface.py
index 38d2404..3c726b2 100644
--- a/test/vpp_sub_interface.py
+++ b/test/vpp_sub_interface.py
@@ -35,10 +35,13 @@
self._parent = parent
self._parent.add_sub_if(self)
self._sub_id = sub_id
- self.set_vtr(L2_VTR_OP.L2_DISABLED)
self.DOT1AD_TYPE = 0x88A8
self.DOT1Q_TYPE = 0x8100
+ def set_sw_if_index(self, sw_if_index):
+ super(VppSubInterface, self).set_sw_if_index(sw_if_index)
+ self.set_vtr(L2_VTR_OP.L2_DISABLED)
+
@abstractmethod
def create_arp_req(self):
pass
@@ -47,18 +50,12 @@
def create_ndp_req(self):
pass
- def resolve_arp(self):
- super(VppSubInterface, self).resolve_arp(self.parent)
-
- def resolve_ndp(self):
- super(VppSubInterface, self).resolve_ndp(self.parent)
-
@abstractmethod
def add_dot1_layer(self, pkt):
pass
def remove_vpp_config(self):
- self.test.vapi.delete_subif(self._sw_if_index)
+ self.test.vapi.delete_subif(self.sw_if_index)
def _add_tag(self, packet, vlan, tag_type):
payload = packet.payload
@@ -129,12 +126,12 @@
return self._vlan
def __init__(self, test, parent, sub_id, vlan=None):
+ super(VppDot1QSubint, self).__init__(test, parent, sub_id)
if vlan is None:
vlan = sub_id
self._vlan = vlan
r = test.vapi.create_vlan_subif(parent.sw_if_index, vlan)
- self._sw_if_index = r.sw_if_index
- super(VppDot1QSubint, self).__init__(test, parent, sub_id)
+ self.set_sw_if_index(r.sw_if_index)
def create_arp_req(self):
packet = VppPGInterface.create_arp_req(self)
@@ -166,13 +163,13 @@
return self._inner_vlan
def __init__(self, test, parent, sub_id, outer_vlan, inner_vlan):
+ super(VppDot1ADSubint, self).__init__(test, parent, sub_id)
r = test.vapi.create_subif(parent.sw_if_index, sub_id, outer_vlan,
inner_vlan, dot1ad=1, two_tags=1,
exact_match=1)
- self._sw_if_index = r.sw_if_index
+ self.set_sw_if_index(r.sw_if_index)
self._outer_vlan = outer_vlan
self._inner_vlan = inner_vlan
- super(VppDot1ADSubint, self).__init__(test, parent, sub_id)
def create_arp_req(self):
packet = VppPGInterface.create_arp_req(self)
@@ -193,12 +190,12 @@
class VppP2PSubint(VppSubInterface):
def __init__(self, test, parent, sub_id, remote_mac):
+ super(VppP2PSubint, self).__init__(test, parent, sub_id)
r = test.vapi.create_p2pethernet_subif(parent.sw_if_index,
remote_mac, sub_id)
- self._sw_if_index = r.sw_if_index
+ self.set_sw_if_index(r.sw_if_index)
self.parent_sw_if_index = parent.sw_if_index
self.p2p_remote_mac = remote_mac
- super(VppP2PSubint, self).__init__(test, parent, sub_id)
def add_dot1_layer(self, packet):
return packet