summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--test/bfd.py2
-rw-r--r--test/test_bfd.py16
2 files changed, 10 insertions, 8 deletions
diff --git a/test/bfd.py b/test/bfd.py
index d1d948b323e..452a1804988 100644
--- a/test/bfd.py
+++ b/test/bfd.py
@@ -237,7 +237,7 @@ class VppBFDUDPSession(VppObject):
""" Represents BFD UDP session in VPP """
def __init__(self, test, interface, peer_addr, local_addr=None, af=AF_INET,
- desired_min_tx=100000, required_min_rx=100000, detect_mult=3,
+ desired_min_tx=300000, required_min_rx=300000, detect_mult=3,
sha1_key=None, bfd_key_id=None):
self._test = test
self._interface = interface
diff --git a/test/test_bfd.py b/test/test_bfd.py
index 4e3f688b462..c9d0abdd91d 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,