summaryrefslogtreecommitdiffstats
path: root/test/test_p2p_ethernet.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-03-16 03:22:39 -0700
committerNeale Ranns <nranns@cisco.com>2018-03-18 03:16:49 -0700
commit2ae2bc5380845d1480ec385749b7e8515e3b2185 (patch)
tree417ed52791d5735b3fbf55bfc2c105f32e66b860 /test/test_p2p_ethernet.py
parent33d162909f9d87507d85d494527d121e081f4a58 (diff)
Remove unnumbered configuration on interface delete
Change-Id: Iae5532c3d53e208831f3b2782242d9e59d367087 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/test_p2p_ethernet.py')
-rw-r--r--test/test_p2p_ethernet.py51
1 files changed, 31 insertions, 20 deletions
diff --git a/test/test_p2p_ethernet.py b/test/test_p2p_ethernet.py
index 5295d1c0c6e..d6d5c5071c4 100644
--- a/test/test_p2p_ethernet.py
+++ b/test/test_p2p_ethernet.py
@@ -126,15 +126,19 @@ class P2PEthernetIPV6(VppTestCase):
super(P2PEthernetIPV6, self).setUp()
for p in self.packets:
self.packets.remove(p)
- self.create_p2p_ethernet(self.pg0, 1, self.pg0._remote_hosts[0].mac)
- self.create_p2p_ethernet(self.pg0, 2, self.pg0._remote_hosts[1].mac)
- self.p2p_sub_ifs[0].config_ip6()
- self.p2p_sub_ifs[1].config_ip6()
+ self.p2p_sub_ifs.append(
+ self.create_p2p_ethernet(self.pg0, 1,
+ self.pg0._remote_hosts[0].mac))
+ self.p2p_sub_ifs.append(
+ self.create_p2p_ethernet(self.pg0, 2,
+ self.pg0._remote_hosts[1].mac))
self.vapi.cli("trace add p2p-ethernet-input 50")
def tearDown(self):
- self.delete_p2p_ethernet(self.pg0, self.pg0._remote_hosts[0].mac)
- self.delete_p2p_ethernet(self.pg0, self.pg0._remote_hosts[1].mac)
+ while len(self.p2p_sub_ifs):
+ p2p = self.p2p_sub_ifs.pop()
+ self.delete_p2p_ethernet(p2p)
+
super(P2PEthernetIPV6, self).tearDown()
def create_p2p_ethernet(self, parent_if, sub_id, remote_mac):
@@ -142,11 +146,13 @@ class P2PEthernetIPV6(VppTestCase):
p2p.admin_up()
p2p.config_ip6()
p2p.disable_ipv6_ra()
- self.p2p_sub_ifs.append(p2p)
+ return p2p
- def delete_p2p_ethernet(self, parent_if, remote_mac):
- self.vapi.delete_p2pethernet_subif(parent_if.sw_if_index,
- mactobinary(remote_mac))
+ def delete_p2p_ethernet(self, p2p):
+ p2p.unconfig_ip6()
+ p2p.admin_down()
+ self.vapi.delete_p2pethernet_subif(p2p.parent.sw_if_index,
+ p2p.p2p_remote_mac)
def create_stream(self, src_mac=None, dst_mac=None,
src_ip=None, dst_ip=None, size=None):
@@ -355,15 +361,18 @@ class P2PEthernetIPV4(VppTestCase):
super(P2PEthernetIPV4, self).setUp()
for p in self.packets:
self.packets.remove(p)
- self.create_p2p_ethernet(self.pg0, 1, self.pg0._remote_hosts[0].mac)
- self.create_p2p_ethernet(self.pg0, 2, self.pg0._remote_hosts[1].mac)
- self.p2p_sub_ifs[0].config_ip4()
- self.p2p_sub_ifs[1].config_ip4()
+ self.p2p_sub_ifs.append(
+ self.create_p2p_ethernet(self.pg0, 1,
+ self.pg0._remote_hosts[0].mac))
+ self.p2p_sub_ifs.append(
+ self.create_p2p_ethernet(self.pg0, 2,
+ self.pg0._remote_hosts[1].mac))
self.vapi.cli("trace add p2p-ethernet-input 50")
def tearDown(self):
- self.delete_p2p_ethernet(self.pg0, self.pg0._remote_hosts[0].mac)
- self.delete_p2p_ethernet(self.pg0, self.pg0._remote_hosts[1].mac)
+ while len(self.p2p_sub_ifs):
+ p2p = self.p2p_sub_ifs.pop()
+ self.delete_p2p_ethernet(p2p)
super(P2PEthernetIPV4, self).tearDown()
def create_stream(self, src_mac=None, dst_mac=None,
@@ -401,11 +410,13 @@ class P2PEthernetIPV4(VppTestCase):
p2p = VppP2PSubint(self, parent_if, sub_id, mactobinary(remote_mac))
p2p.admin_up()
p2p.config_ip4()
- self.p2p_sub_ifs.append(p2p)
+ return p2p
- def delete_p2p_ethernet(self, parent_if, remote_mac):
- self.vapi.delete_p2pethernet_subif(parent_if.sw_if_index,
- mactobinary(remote_mac))
+ def delete_p2p_ethernet(self, p2p):
+ p2p.unconfig_ip4()
+ p2p.admin_down()
+ self.vapi.delete_p2pethernet_subif(p2p.parent.sw_if_index,
+ p2p.p2p_remote_mac)
def test_ip4_rx_p2p_subif(self):
"""receive ipv4 packet via p2p subinterface"""