summaryrefslogtreecommitdiffstats
path: root/test/test_bfd.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-05-02 07:38:01 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-02 19:24:38 +0000
commitf3bcdbf071c98ed676591bd22c3d3f8601009fa8 (patch)
tree96bcd53111bc5ff65b6586db84f27710e5dba5b5 /test/test_bfd.py
parent5d85f2dea9cc77753c68947b6b2ae56101fab9a6 (diff)
BFD: don't crash if interface is deleted
Instead, drop the BFD session associated with it.. Change-Id: Ie09877d5c94844be2e833900d9dde7f23edaf8cd Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_bfd.py')
-rw-r--r--test/test_bfd.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_bfd.py b/test/test_bfd.py
index 0923d36d8ba..be42cdadd46 100644
--- a/test/test_bfd.py
+++ b/test/test_bfd.py
@@ -17,6 +17,7 @@ from bfd import VppBFDAuthKey, BFD, BFDAuthType, VppBFDUDPSession, \
BFDDiagCode, BFDState, BFD_vpp_echo
from framework import VppTestCase, VppTestRunner, running_extended_tests
from vpp_pg_interface import CaptureTimeoutError, is_ipv6_misc
+from vpp_lo_interface import VppLoInterface
from util import ppp
from vpp_papi_provider import UnexpectedApiReturnValueError
from vpp_ip_route import VppIpRoute, VppRoutePath
@@ -1403,6 +1404,20 @@ class BFD4TestCase(VppTestCase):
self.assert_equal(count, 0, "number of packets received")
self.assert_equal(len(events), 0, "number of events received")
+ def test_intf_deleted(self):
+ """ interface with bfd session deleted """
+ intf = VppLoInterface(self, 0)
+ intf.config_ip4()
+ intf.admin_up()
+ sw_if_index = intf.sw_if_index
+ vpp_session = VppBFDUDPSession(self, intf, intf.remote_ip4)
+ vpp_session.add_vpp_config()
+ vpp_session.admin_up()
+ intf.remove_vpp_config()
+ e = self.vapi.wait_for_event(1, "bfd_udp_session_details")
+ self.assert_equal(e.sw_if_index, sw_if_index, "sw_if_index")
+ self.assertFalse(vpp_session.query_vpp_config())
+
@unittest.skipUnless(running_extended_tests(), "part of extended tests")
class BFD6TestCase(VppTestCase):
@@ -1597,6 +1612,21 @@ class BFD6TestCase(VppTestCase):
self.test_session.send_packet()
self.assertTrue(echo_seen, "No echo packets received")
+ def test_intf_deleted(self):
+ """ interface with bfd session deleted """
+ intf = VppLoInterface(self, 0)
+ intf.config_ip6()
+ intf.admin_up()
+ sw_if_index = intf.sw_if_index
+ vpp_session = VppBFDUDPSession(
+ self, intf, intf.remote_ip6, af=AF_INET6)
+ vpp_session.add_vpp_config()
+ vpp_session.admin_up()
+ intf.remove_vpp_config()
+ e = self.vapi.wait_for_event(1, "bfd_udp_session_details")
+ self.assert_equal(e.sw_if_index, sw_if_index, "sw_if_index")
+ self.assertFalse(vpp_session.query_vpp_config())
+
@unittest.skipUnless(running_extended_tests(), "part of extended tests")
class BFDFIBTestCase(VppTestCase):