summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Scherpelz <jscherpelz@google.com>2017-03-06 17:42:27 +0900
committerJoel Scherpelz <jscherpelz@google.com>2017-03-06 17:59:51 +0900
commit4b5bf38890cb46f42e4769d545401c217a73687a (patch)
treeea158d57657957363fa039a4bf290651d039fc7a
parenta6148e22f7217b4e8c49217ac3258e9ae5ab3763 (diff)
downloadtests-4b5bf38890cb46f42e4769d545401c217a73687a.tar.gz
Disable RIOTest route lifetime assert on kernels before 3.13android-o-preview-1android-n-mr2-preview-2o-preview
Also add a small delay after each RIO to give the kernel time to notice updates before making assertions about routing table state. Note that bullhead and angler have backported commit: f104a567e673f382b09542a8dc3500aa689957b4 ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv which makes it difficult to predict how earlier kernels will behave. Bug: 33333670 Test: net_test has now been run on android-msm-angler-3.10 and android-msm-bullhead-3.10 in addition to android common kernels. Change-Id: I98fe507e06686af9a2b431735b7e5e554661b280
-rwxr-xr-xnet/test/multinetwork_test.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/net/test/multinetwork_test.py b/net/test/multinetwork_test.py
index 9afd906..0ade759 100755
--- a/net/test/multinetwork_test.py
+++ b/net/test/multinetwork_test.py
@@ -630,9 +630,13 @@ class RIOTest(multinetwork_base.MultiNetworkBaseTest):
PRF = 0
self.SetAcceptRaRtInfoMaxPlen(PLEN)
self.SendRIO(RTLIFETIME, PLEN, PREFIX, PRF)
+ # Give the kernel time to notice our RA
+ time.sleep(0.01)
self.assertTrue(self.FindRoutesWithDestination(PREFIX))
# RIO with rtlifetime = 0 should remove from routing table
self.SendRIO(0, PLEN, PREFIX, PRF)
+ # Give the kernel time to notice our RA
+ time.sleep(0.01)
self.assertFalse(self.FindRoutesWithDestination(PREFIX))
@unittest.skipUnless(HAVE_MAX_PLEN and multinetwork_base.HAVE_AUTOCONF_TABLE,
@@ -645,6 +649,8 @@ class RIOTest(multinetwork_base.MultiNetworkBaseTest):
self.SetAcceptRaRtInfoMaxPlen(plen)
# RIO with plen > max_plen should be ignored
self.SendRIO(RTLIFETIME, plen + 1, PREFIX, PRF)
+ # Give the kernel time to notice our RA
+ time.sleep(0.01)
routes = self.FindRoutesWithDestination(PREFIX)
self.assertFalse(routes)
@@ -663,15 +669,16 @@ class RIOTest(multinetwork_base.MultiNetworkBaseTest):
# RIO with prefix length = 0, should overwrite default route lifetime
# note that the RIO lifetime overwrites the RA lifetime.
self.SendRIO(RTLIFETIME, PLEN, PREFIX, PRF)
+ # Give the kernel time to notice our RA
+ time.sleep(0.01)
default = self.FindRoutesWithGateway()
self.assertTrue(default)
- if net_test.LINUX_VERSION < (3, 13, 0):
- # Versions earlier than 3.13 overwrite the default route lifetime with
- # zero and unset RTF_EXPIRES in rt6i_flags after receiving a RIO with a
- # zero length prefix. Later versions explicitly check for a zero length
- # prefix and handle that as a special case.
- self.assertEquals(self.GetRouteExpiration(default[0]), 0)
- else:
+ if net_test.LINUX_VERSION > (3, 12, 0):
+ # Vanilla linux earlier than 3.13 handles RIOs with zero length prefixes
+ # incorrectly. There's nothing useful to assert other than the existence
+ # of a default route.
+ # TODO: remove this condition after pulling bullhead/angler backports to
+ # other 3.10 flavors.
self.assertGreater(self.GetRouteExpiration(default[0]), self.RA_VALIDITY)
@unittest.skipUnless(HAVE_MAX_PLEN and multinetwork_base.HAVE_AUTOCONF_TABLE,