summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-12-14 16:44:20 +0900
committerLorenzo Colitti <lorenzo@google.com>2015-12-14 17:01:27 +0900
commit1717866cce4219e66e3ef8ace0ecd29ecb946fb9 (patch)
treec1406330a5c1961bfc5a2fbd270197beb8a4a2b2
parent34e3b9fe8c25979f1a4aff76a5261568c2341019 (diff)
downloadextras-1717866cce4219e66e3ef8ace0ecd29ecb946fb9.tar.gz
Add a tests that checks NAs with the R flag set to 0.
NAs with R=0 have been implicated in loss of connectivity. This test checks that they behave as expected. Change-Id: I08e82f704cde4f40b423c8f52a34fef1ebfd74ee
-rwxr-xr-xtests/net_test/neighbour_test.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/net_test/neighbour_test.py b/tests/net_test/neighbour_test.py
index c80a0d45..64518a97 100755
--- a/tests/net_test/neighbour_test.py
+++ b/tests/net_test/neighbour_test.py
@@ -260,6 +260,35 @@ class NeighbourTest(multinetwork_base.MultiNetworkBaseTest):
for _ in xrange(5):
ForceProbe(router6, routermac)
+ def testIsRouterFlag(self):
+ router6 = self._RouterAddress(self.netid, 6)
+ self.assertNeighbourState(NUD_STALE, router6)
+
+ # Get into FAILED.
+ ifindex = self.ifindices[self.netid]
+ self.iproute.UpdateNeighbour(6, router6, None, ifindex, NUD_FAILED)
+ self.ExpectNeighbourNotification(router6, NUD_FAILED)
+ self.assertNeighbourState(NUD_FAILED, router6)
+
+ time.sleep(1)
+
+ # Send another packet and expect a multicast NS.
+ routing_mode = random.choice(["mark", "oif", "uid"])
+ s = self.BuildSocket(6, net_test.UDPSocket, self.netid, routing_mode)
+ s.connect((net_test.IPV6_ADDR, 53))
+ s.send(net_test.UDP_PAYLOAD)
+ self.ExpectMulticastNS(router6)
+
+ # Receive a unicast NA with the R flag set to 0.
+ self.ReceiveUnicastAdvertisement(router6, self.RouterMacAddress(self.netid),
+ srcaddr=self._RouterAddress(self.netid, 6),
+ dstaddr=self.MyAddress(6, self.netid),
+ S=1, O=0, R=0)
+
+ # Expect that this takes us to REACHABLE.
+ self.ExpectNeighbourNotification(router6, NUD_REACHABLE)
+ self.assertNeighbourState(NUD_REACHABLE, router6)
+
if __name__ == "__main__":
unittest.main()