X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_gbp.py;h=53dcf3bfd340a8a8047ba3166b85b86ac910231a;hb=e88865d;hp=4a5969213be6f241a7c3084a554f66c479f59589;hpb=b6a47953973f7c94239c394b649100e91bdb2152;p=vpp.git diff --git a/test/test_gbp.py b/test/test_gbp.py index 4a5969213be..53dcf3bfd34 100644 --- a/test/test_gbp.py +++ b/test/test_gbp.py @@ -2,7 +2,8 @@ import unittest -from framework import VppTestCase, VppTestRunner +from framework import VppTestCase, VppTestRunner, is_skip_aarch64_set, \ + is_platform_aarch64 from vpp_object import VppObject from vpp_neighbor import VppNeighbor from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, \ @@ -1424,6 +1425,16 @@ class TestGBP(VppTestCase): is_inside=0, is_add=0) + def wait_for_ep_timeout(self, sw_if_index=None, ip=None, mac=None, + n_tries=100, s_time=1): + while (n_tries): + if not find_gbp_endpoint(self, sw_if_index, ip, mac): + return True + n_tries = n_tries - 1 + self.sleep(s_time) + self.assertFalse(find_gbp_endpoint(self, sw_if_index, ip, mac)) + return False + def test_gbp_learn_l2(self): """ GBP L2 Endpoint Learning """ @@ -1586,10 +1597,9 @@ class TestGBP(VppTestCase): # If we sleep for the threshold time, the learnt endpoints should # age out # - self.sleep(2) for l in learnt: - self.assertFalse(find_gbp_endpoint(self, - mac=l['mac'])) + self.wait_for_ep_timeout(vx_tun_l2_1.sw_if_index, + mac=l['mac']) # # repeat. the do not learn bit is set so the EPs are not learnt @@ -1660,11 +1670,9 @@ class TestGBP(VppTestCase): self.assertTrue(rx[VXLAN].gpflags.A) self.assertFalse(rx[VXLAN].gpflags.D) - self.sleep(2) for l in learnt: - self.assertFalse(find_gbp_endpoint(self, - vx_tun_l2_1.sw_if_index, - mac=l['mac'])) + self.wait_for_ep_timeout(vx_tun_l2_1.sw_if_index, + mac=l['mac']) # # repeat in the other EPG @@ -1809,11 +1817,9 @@ class TestGBP(VppTestCase): # # clean up # - self.sleep(2) for l in learnt: - self.assertFalse(find_gbp_endpoint(self, - vx_tun_l2_1.sw_if_index, - mac=l['mac'])) + self.wait_for_ep_timeout(vx_tun_l2_1.sw_if_index, + mac=l['mac']) self.pg2.unconfig_ip4() self.pg3.unconfig_ip4() @@ -1822,6 +1828,8 @@ class TestGBP(VppTestCase): self.logger.info(self.vapi.cli("sh int")) self.logger.info(self.vapi.cli("sh gbp vxlan")) + @unittest.skipIf(is_skip_aarch64_set() and is_platform_aarch64(), + "test doesn't work on aarch64") def test_gbp_learn_vlan_l2(self): """ GBP L2 Endpoint w/ VLANs""" @@ -1990,6 +1998,8 @@ class TestGBP(VppTestCase): self.pg2.unconfig_ip4() self.pg3.unconfig_ip4() + @unittest.skipIf(is_skip_aarch64_set() and is_platform_aarch64(), + "test doesn't work on aarch64") def test_gbp_learn_l3(self): """ GBP L3 Endpoint Learning """ @@ -2161,7 +2171,6 @@ class TestGBP(VppTestCase): self.assertEqual(inner[IP].src, ep.ip4.address) self.assertEqual(inner[IP].dst, l['ip']) - self.sleep(2) for l in learnt: self.assertFalse(find_gbp_endpoint(self, tep1_sw_if_index, @@ -2236,11 +2245,8 @@ class TestGBP(VppTestCase): self.assertEqual(inner[IPv6].dst, l['ip6']) self.logger.info(self.vapi.cli("sh gbp endpoint")) - self.sleep(2) for l in learnt: - self.assertFalse(find_gbp_endpoint(self, - tep1_sw_if_index, - ip=l['ip'])) + self.wait_for_ep_timeout(ip=l['ip']) # # Static sends to unknown EP with no route