summaryrefslogtreecommitdiffstats
path: root/test/bfd.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2016-12-08 10:16:41 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-09 09:00:26 +0000
commite4504c6320790bba27fccf3746eb38f75f4d2e95 (patch)
treee690d99b07e4259e3be22a74662f49f80d4c5397 /test/bfd.py
parent56912c896ae803fad01af390ade921be68ea5ba2 (diff)
BFD: fix timing in the main loop
Properly wakeup the main process loop only when necessary to avoid missed events. Improve BFD unit test reliability and speed. Add timestamps to logs and replace Queue with more efficient deque. Change-Id: I01255a02057d3146917b43b669ccdc74f31ef0c8 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/bfd.py')
-rw-r--r--test/bfd.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/bfd.py b/test/bfd.py
index beacd80f687..fe63264e731 100644
--- a/test/bfd.py
+++ b/test/bfd.py
@@ -161,7 +161,8 @@ class VppBFDUDPSession(VppObject):
def detect_mult(self):
return self._detect_mult
- def __init__(self, test, interface, peer_addr, local_addr=None, af=AF_INET):
+ def __init__(self, test, interface, peer_addr, local_addr=None, af=AF_INET,
+ desired_min_tx=100000, required_min_rx=100000, detect_mult=3):
self._test = test
self._interface = interface
self._af = af
@@ -169,9 +170,9 @@ class VppBFDUDPSession(VppObject):
self._peer_addr = peer_addr
self._peer_addr_n = socket.inet_pton(af, peer_addr)
self._bs_index = None
- self._desired_min_tx = 200000 # 0.2s
- self._required_min_rx = 200000 # 0.2s
- self._detect_mult = 3 # 3 packets need to be missed
+ self._desired_min_tx = desired_min_tx
+ self._required_min_rx = required_min_rx
+ self._detect_mult = detect_mult
def add_vpp_config(self):
is_ipv6 = 1 if AF_INET6 == self.af else 0