summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Scherpelz <jscherpelz@google.com>2017-03-06 09:10:37 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-06 09:10:37 +0000
commit141feea324c3b073fd2850d59103f2f39b7fec1f (patch)
treeea158d57657957363fa039a4bf290651d039fc7a
parent2dc877515d5cdda502608563e2937d8b8e3c5e3e (diff)
parent4b5bf38890cb46f42e4769d545401c217a73687a (diff)
downloadtests-141feea324c3b073fd2850d59103f2f39b7fec1f.tar.gz
Disable RIOTest route lifetime assert on kernels before 3.13
am: 4b5bf38890 Change-Id: Icb5b8ed01f5bb745f622a0b9baea4a67e8172516
-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,