aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_bfd.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-04-03 08:10:08 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-04-03 17:23:56 +0000
commit2e01dfa25dd47488e6120bfcaea567fc1093f0b8 (patch)
tree855f2b11f83e1735abc3c4102ac21a14930c77e1 /test/test_bfd.py
parent2c35e5849d0c87ce5d63724d35f98379187519d8 (diff)
make test: relax BFD time intervals
Increased time intervals mean longer test runs, but also reduce the chance of getting annoying (especially in gerrit) random failures. Now that tests are split into `basic' and `all', the increased runtime of BFD tests (of which majority doesn't run in basic case) doesn't matter too much.. Change-Id: I4a15bb4facad634f123bc9cc6f45eddbf4976fd1 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_bfd.py')
-rw-r--r--test/test_bfd.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/test_bfd.py b/test/test_bfd.py
index 4e3f688b..c9d0abdd 100644
--- a/test/test_bfd.py
+++ b/test/test_bfd.py
@@ -267,8 +267,8 @@ class BFDTestSession(object):
self.our_seq_number = our_seq_number
self.vpp_seq_number = None
self.my_discriminator = 0
- self.desired_min_tx = 100000
- self.required_min_rx = 100000
+ self.desired_min_tx = 300000
+ self.required_min_rx = 300000
self.required_min_echo_rx = None
self.detect_mult = detect_mult
self.diag = BFDDiagCode.no_diagnostic
@@ -735,7 +735,7 @@ class BFD4TestCase(VppTestCase):
pass
self.assert_equal(
len(self.vapi.collect_events()), 0, "number of bfd events")
- self.test_session.update(required_min_rx=100000)
+ self.test_session.update(required_min_rx=300000)
for dummy in range(3):
self.test_session.send_packet()
wait_for_bfd_packet(
@@ -864,7 +864,8 @@ class BFD4TestCase(VppTestCase):
required_min_rx=0.5 * self.vpp_session.required_min_rx)
# now we wait 0.8*3*old-req-min-rx and the session should still be up
self.sleep(0.8 * self.vpp_session.detect_mult *
- old_required_min_rx / USEC_IN_SEC)
+ old_required_min_rx / USEC_IN_SEC,
+ "wait before finishing poll sequence")
self.assert_equal(len(self.vapi.collect_events()), 0,
"number of bfd events")
p = wait_for_bfd_packet(self)
@@ -876,11 +877,12 @@ class BFD4TestCase(VppTestCase):
final[BFD].flags = "F"
self.test_session.send_packet(final)
# now the session should time out under new conditions
- before = time.time()
- e = self.vapi.wait_for_event(1, "bfd_udp_session_details")
- after = time.time()
detection_time = self.test_session.detect_mult *\
self.vpp_session.required_min_rx / USEC_IN_SEC
+ before = time.time()
+ e = self.vapi.wait_for_event(
+ 2 * detection_time, "bfd_udp_session_details")
+ after = time.time()
self.assert_in_range(after - before,
0.9 * detection_time,
1.1 * detection_time,