aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-12-20 06:12:19 -0800
committerDave Barach <openvpp@barachs.net>2018-12-20 22:47:05 +0000
commit00a469d9691da6f2371bcc5a97adb020c011b4b4 (patch)
tree6c13b87f5609223ff282bf0da204b5fc85f02de4 /test
parent1af9ab58fc25ae8b42bbf758eb63e04e0d1fafd1 (diff)
GBP: test case hardening against timing races
Change-Id: I3b5d369a37233c7bb2113ce31479371c610977ef Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_gbp.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 9e930242026..2297c49ffa1 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -1444,7 +1444,7 @@ class TestGBP(VppTestCase):
# lower the inactive threshold so these tests pass in a
# reasonable amount of time
#
- self.vapi.gbp_endpoint_learn_set_inactive_threshold(1)
+ self.vapi.gbp_endpoint_learn_set_inactive_threshold(2)
#
# IP tables
@@ -1839,7 +1839,7 @@ class TestGBP(VppTestCase):
# lower the inactive threshold so these tests pass in a
# reasonable amount of time
#
- self.vapi.gbp_endpoint_learn_set_inactive_threshold(1)
+ self.vapi.gbp_endpoint_learn_set_inactive_threshold(2)
#
# IP tables
@@ -2014,7 +2014,7 @@ class TestGBP(VppTestCase):
# lower the inactive threshold so these tests pass in a
# reasonable amount of time
#
- self.vapi.gbp_endpoint_learn_set_inactive_threshold(1)
+ self.vapi.gbp_endpoint_learn_set_inactive_threshold(2)
#
# IP tables
@@ -2384,30 +2384,29 @@ class TestGBP(VppTestCase):
rep_88.remove_vpp_config()
rep_2.remove_vpp_config()
- self.logger.info(self.vapi.cli("show gbp endpoint"))
-
- self.assertFalse(find_gbp_endpoint(self, ip=rep_88.ip4.address))
+ self.assertTrue(find_gbp_endpoint(self, ip=rep_2.ip4.address))
p = (Ether(src=ep.mac, dst=self.loop0.local_mac) /
- IP(src=ep.ip4.address, dst=rep_88.ip4.address) /
+ IP(src=ep.ip4.address, dst=rep_2.ip4.address) /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rxs = self.send_and_expect(self.pg0, [p], self.pg4)
+ rxs = self.send_and_expect(self.pg0, [p], self.pg2)
- self.assertTrue(find_gbp_endpoint(self, ip=rep_2.ip4.address))
+ self.assertFalse(find_gbp_endpoint(self, ip=rep_88.ip4.address))
p = (Ether(src=ep.mac, dst=self.loop0.local_mac) /
- IP(src=ep.ip4.address, dst=rep_2.ip4.address) /
+ IP(src=ep.ip4.address, dst=rep_88.ip4.address) /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rxs = self.send_and_expect(self.pg0, [p], self.pg2)
+ rxs = self.send_and_expect(self.pg0, [p], self.pg4)
#
# to appease the testcase we cannot have the registered EP stll
# present (because it's DP learnt) when the TC ends so wait until
# it is removed
#
- self.sleep(2)
+ self.wait_for_ep_timeout(ip=rep_88.ip4.address)
+ self.wait_for_ep_timeout(ip=rep_2.ip4.address)
#
# shutdown with learnt endpoint present
@@ -2458,7 +2457,7 @@ class TestGBP(VppTestCase):
# lower the inactive threshold so these tests pass in a
# reasonable amount of time
#
- self.vapi.gbp_endpoint_learn_set_inactive_threshold(1)
+ self.vapi.gbp_endpoint_learn_set_inactive_threshold(2)
#
# IP tables