Merge "Annotate a few tests with the relevant kernel commits."
diff --git a/tests/net_test/anycast_test.py b/tests/net_test/anycast_test.py
index 4b03664..82130db 100755
--- a/tests/net_test/anycast_test.py
+++ b/tests/net_test/anycast_test.py
@@ -55,7 +55,15 @@
 
 
 class AnycastTest(multinetwork_base.MultiNetworkBaseTest):
+  """Tests for IPv6 anycast addresses.
 
+  Relevant kernel commits:
+    upstream net-next:
+      381f4dc ipv6: clean up anycast when an interface is destroyed
+
+    android-3.10:
+      86a47ad ipv6: clean up anycast when an interface is destroyed
+  """
   _TEST_NETID = 123
 
   def AnycastSetsockopt(self, s, is_add, netid, addr):
diff --git a/tests/net_test/iproute.py b/tests/net_test/iproute.py
index 9cc8257..f2aba7b 100644
--- a/tests/net_test/iproute.py
+++ b/tests/net_test/iproute.py
@@ -209,7 +209,6 @@
 
 
 class IPRoute(object):
-
   """Provides a tiny subset of iproute functionality."""
 
   BUFSIZE = 65536
diff --git a/tests/net_test/multinetwork_base.py b/tests/net_test/multinetwork_base.py
index 97e4d37..24b9575 100644
--- a/tests/net_test/multinetwork_base.py
+++ b/tests/net_test/multinetwork_base.py
@@ -100,7 +100,6 @@
 
 
 class MultiNetworkBaseTest(net_test.NetworkTest):
-
   """Base class for all multinetwork tests.
 
   This class does not contain any test code, but contains code to set up and
diff --git a/tests/net_test/multinetwork_test.py b/tests/net_test/multinetwork_test.py
index e9cd8f1..ce9ce07 100755
--- a/tests/net_test/multinetwork_test.py
+++ b/tests/net_test/multinetwork_test.py
@@ -937,6 +937,16 @@
         self.assertEquals(metrics["RTAX_MTU"], 1280)
 
   def testIPv4BasicPMTU(self):
+    """Tests IPv4 path MTU discovery.
+
+    Relevant kernel commits:
+      upstream net-next:
+        6a66271 ipv4, fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif
+
+      android-3.10:
+        4bc64dd ipv4, fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif
+    """
+
     self.CheckPMTU(4, True, ["mark", "oif"])
     self.CheckPMTU(4, False, ["mark", "oif"])
 
@@ -976,6 +986,17 @@
 
 @unittest.skipUnless(multinetwork_base.HAVE_UID_ROUTING, "no UID routes")
 class UidRoutingTest(multinetwork_base.MultiNetworkBaseTest):
+  """Tests that per-UID routing works properly.
+
+  Relevant kernel commits:
+    android-3.4:
+      0b42874 net: core: Support UID-based routing.
+      0836a0c Handle 'sk' being NULL in UID-based routing.
+
+    android-3.10:
+      99a6ea4 net: core: Support UID-based routing.
+      455b09d Handle 'sk' being NULL in UID-based routing.
+  """
 
   def GetRulesAtPriority(self, version, priority):
     rules = self.iproute.DumpRules(version)
diff --git a/tests/net_test/neighbour_test.py b/tests/net_test/neighbour_test.py
index b45b353..0e5a34d 100755
--- a/tests/net_test/neighbour_test.py
+++ b/tests/net_test/neighbour_test.py
@@ -139,7 +139,7 @@
       print self.GetNdEntry(addr)
 
   def MonitorSleep(self, intervalseconds, addr):
-    self.MonitorSleepMs(interval * 1000, addr)
+    self.MonitorSleepMs(intervalseconds * 1000, addr)
 
   def SleepMs(self, ms):
     time.sleep(ms / 1000.0)
diff --git a/tests/net_test/net_test.py b/tests/net_test/net_test.py
index be034d0..6628d35 100755
--- a/tests/net_test/net_test.py
+++ b/tests/net_test/net_test.py
@@ -292,7 +292,6 @@
 
 
 class RunAsUid(object):
-
   """Context guard to run a code block as a given UID."""
 
   def __init__(self, uid):
diff --git a/tests/net_test/ping6_test.py b/tests/net_test/ping6_test.py
index 8fc82d1..cfc7d7a 100755
--- a/tests/net_test/ping6_test.py
+++ b/tests/net_test/ping6_test.py
@@ -380,7 +380,15 @@
     # No crash? Good.
 
   def testCrossProtocolCalls(self):
-    """Tests that passing in the wrong family returns EAFNOSUPPORT."""
+    """Tests that passing in the wrong family returns EAFNOSUPPORT.
+
+    Relevant kernel commits:
+      upstream net:
+        9145736 net: ping: Return EAFNOSUPPORT when appropriate.
+
+      android-3.10:
+        428e6d6 net: ping: Return EAFNOSUPPORT when appropriate.
+    """
 
     def CheckEAFNoSupport(function, *args):
       self.assertRaisesErrno(errno.EAFNOSUPPORT, function, *args)
diff --git a/tests/net_test/srcaddr_selection_test.py b/tests/net_test/srcaddr_selection_test.py
index b2f3152..8145295 100755
--- a/tests/net_test/srcaddr_selection_test.py
+++ b/tests/net_test/srcaddr_selection_test.py
@@ -15,7 +15,6 @@
 # limitations under the License.
 
 import errno
-import os
 import random
 from socket import *  # pylint: disable=wildcard-import
 import time
@@ -35,6 +34,22 @@
 
 
 class IPv6SourceAddressSelectionTest(multinetwork_base.MultiNetworkBaseTest):
+  """Test for IPv6 source address selection.
+
+  Relevant kernel commits:
+    upstream net-next:
+      7fd2561 net: ipv6: Add a sysctl to make optimistic addresses useful candidates
+      c58da4c net: ipv6: allow explicitly choosing optimistic addresses
+      9131f3d ipv6: Do not iterate over all interfaces when finding source address on specific interface.
+      c0b8da1 ipv6: Fix finding best source address in ipv6_dev_get_saddr().
+      c15df30 ipv6: Remove unused arguments for __ipv6_dev_get_saddr().
+      3985e8a ipv6: sysctl to restrict candidate source addresses
+
+    android-3.10:
+      2ce95507 net: ipv6: Add a sysctl to make optimistic addresses useful candidates
+      0065bf4 net: ipv6: allow choosing optimistic addresses with use_optimistic
+      0633924 ipv6: sysctl to restrict candidate source addresses
+  """
 
   def SetIPv6Sysctl(self, ifname, sysctl, value):
     self.SetSysctl("/proc/sys/net/ipv6/conf/%s/%s" % (ifname, sysctl), value)
@@ -138,7 +153,7 @@
 
     self.assertAddressNotUsable(self.test_ip, self.test_netid)
     # Verify that the link-local address is not tentative.
-    self.assertFalse(self.AddressIsTentative(self.test_lladdr));
+    self.assertFalse(self.AddressIsTentative(self.test_lladdr))
 
 
 class TentativeAddressTest(MultiInterfaceSourceAddressSelectionTest):
@@ -313,8 +328,8 @@
     src_ip = self.GetSourceIP(self.test_netid)
     self.assertFalse(src_ip in [self.test_ip, self.test_lladdr])
     self.assertTrue(src_ip in
-        [self.MyAddress(6, netid)
-         for netid in self.tuns if netid != self.test_netid])
+                    [self.MyAddress(6, netid)
+                     for netid in self.tuns if netid != self.test_netid])
 
 
 class RestrictedCandidateSrcAddrsTest(MultiInterfaceSourceAddressSelectionTest):