From: Lorenzo Colitti Date: Thu, 10 Apr 2014 11:43:15 +0000 (+0900) Subject: Deflakify the PMTU test. X-Git-Tag: android-x86-6.0-r1~14^2~13^2~74 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=98eb6fdc5f8dc40f3923680cb6a5f38d96b15816;p=android-x86%2Fsystem-extras.git Deflakify the PMTU test. For reasons I don't understand, sending traffic and receiving a Packet Too Big error just after the network is set up sometimes doesn't work - the packet doesn't even make it to icmpv6_rcv. Add a sleep statement to fix this for now. Change-Id: If1751e005a89f44c4d1784ef46bef97031c90a64 --- diff --git a/tests/net_test/mark_test.py b/tests/net_test/mark_test.py index 9919b830..784512c0 100755 --- a/tests/net_test/mark_test.py +++ b/tests/net_test/mark_test.py @@ -8,6 +8,7 @@ import random import re from socket import * # pylint: disable=wildcard-import import struct +import time import unittest from scapy import all as scapy @@ -957,7 +958,7 @@ class RATest(MultiNetworkTest): self.assertEquals(num_routes, GetNumRoutes()) -class RedirectAndPMTUTest(MultiNetworkTest): +class PMTUTest(MultiNetworkTest): IPV6_PATHMTU = 61 IPV6_DONTFRAG = 62 @@ -989,6 +990,11 @@ class RedirectAndPMTUTest(MultiNetworkTest): self.assertEquals(1500, self.GetSocketMTU(s)) self.ClearTunQueues() + # XXX why is this needed? It seems that if this is not there, the packet + # won't even make it to icmpv6_rcv. Perhaps the local delivery route for + # our IP address has not been set up yet? But why should that take 0.5s? + # DAD is disabled, so we're not waiting for DAD... + time.sleep(0.5) s.send(1400 * "a") packets = self.ReadAllPacketsOn(netid) self.assertEquals(1, len(packets))