diff options
Diffstat (limited to 'test/test_bfd.py')
-rw-r--r-- | test/test_bfd.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/test_bfd.py b/test/test_bfd.py index b56df3398d5..d047b5a3b99 100644 --- a/test/test_bfd.py +++ b/test/test_bfd.py @@ -42,14 +42,11 @@ class BFDAPITestCase(VppTestCase): """ create the same BFD session twice (negative case) """ session = VppBFDUDPSession(self, self.pg0, self.pg0.remote_ip4) session.add_vpp_config() - try: + + with self.vapi.expect_negative_api_retval(): session.add_vpp_config() - except: - session.remove_vpp_config() - return + session.remove_vpp_config() - raise Exception("Expected failure while adding duplicate " - "configuration") def test_add_two(self): """ create two BFD sessions """ |