aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp/test/test_gbp.py
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-04-16 16:57:00 +0200
committerNeale Ranns <nranns@cisco.com>2020-04-20 07:56:32 +0000
commit040d47c2cce87255a101f301239192c5599b0db5 (patch)
treed6951a1383d4d7e30c65b6e19779add474f01c1d /src/plugins/gbp/test/test_gbp.py
parentc11822959570eaceded776b8091db99667117454 (diff)
gbp: fix l3-out anonymous test cleanup
Type: fix Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/gbp/test/test_gbp.py')
-rw-r--r--src/plugins/gbp/test/test_gbp.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/gbp/test/test_gbp.py b/src/plugins/gbp/test/test_gbp.py
index e950a5abd57..872ab4b5297 100644
--- a/src/plugins/gbp/test/test_gbp.py
+++ b/src/plugins/gbp/test/test_gbp.py
@@ -37,7 +37,7 @@ NUM_PKTS = 67
def find_gbp_endpoint(test, sw_if_index=None, ip=None, mac=None,
- tep=None, sclass=None):
+ tep=None, sclass=None, flags=None):
if ip:
vip = ip
if mac:
@@ -58,6 +58,9 @@ def find_gbp_endpoint(test, sw_if_index=None, ip=None, mac=None,
if sclass:
if ep.endpoint.sclass != sclass:
continue
+ if flags:
+ if flags != (flags & ep.endpoint.flags):
+ continue
if ip:
for eip in ep.endpoint.ips:
if vip == str(eip):
@@ -1498,12 +1501,17 @@ class TestGBP(VppTestCase):
def wait_for_ep_timeout(self, sw_if_index=None, ip=None, mac=None,
tep=None, n_tries=100, s_time=1):
+ # only learnt EP can timeout
+ ep_flags = VppEnum.vl_api_gbp_endpoint_flags_t
+ flags = ep_flags.GBP_API_ENDPOINT_FLAG_LEARNT
while (n_tries):
- if not find_gbp_endpoint(self, sw_if_index, ip, mac, tep=tep):
+ if not find_gbp_endpoint(self, sw_if_index, ip, mac, tep=tep,
+ flags=flags):
return True
n_tries = n_tries - 1
self.sleep(s_time)
- self.assertFalse(find_gbp_endpoint(self, sw_if_index, ip, mac))
+ self.assertFalse(find_gbp_endpoint(self, sw_if_index, ip, mac, tep=tep,
+ flags=flags))
return False
def test_gbp_learn_l2(self):
@@ -5843,6 +5851,8 @@ class TestGBP(VppTestCase):
self.vlan_101.set_vtr(L2_VTR_OP.L2_DISABLED)
self.vlan_100.set_vtr(L2_VTR_OP.L2_DISABLED)
self.pg7.unconfig_ip4()
+ # make sure the programmed EP is no longer learnt from DP
+ self.wait_for_ep_timeout(sw_if_index=rep.itf.sw_if_index, ip=rep.ip4)
if __name__ == '__main__':