From: Erik Kline Date: Tue, 14 Oct 2014 06:52:37 +0000 (+0900) Subject: net_test environment changes X-Git-Tag: android-x86-6.0-r1~14^2~13^2~28 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ea56ba43;p=android-x86%2Fsystem-extras.git net_test environment changes - update run_net_test.sh to config-enable privacy addresses and optimistic DAD (both apparently off by default) - update mark_test's SendRA to support passing in the ND retranstimer parameter Change-Id: I348609bcef16e0cb7b1f9cbfd33ef2ab4dcda917 --- diff --git a/tests/net_test/mark_test.py b/tests/net_test/mark_test.py index 2605246b..788cc193 100755 --- a/tests/net_test/mark_test.py +++ b/tests/net_test/mark_test.py @@ -428,19 +428,25 @@ class MultiNetworkTest(net_test.NetworkTest): return f @classmethod - def SendRA(cls, netid): + def SendRA(cls, netid, retranstimer=None): validity = 300 # seconds validity_ms = validity * 1000 # milliseconds macaddr = cls.RouterMacAddress(netid) lladdr = cls._RouterAddress(netid, 6) + if retranstimer is None: + # If no retrans timer was specified, pick one that's as long as the + # router lifetime. This ensures that no spurious ND retransmits + # will interfere with test expectations. + retranstimer = validity + # We don't want any routes in the main table. If the kernel doesn't support # putting RA routes into per-interface tables, configure routing manually. routerlifetime = validity if HAVE_AUTOCONF_TABLE else 0 ra = (scapy.Ether(src=macaddr, dst="33:33:00:00:00:01") / scapy.IPv6(src=lladdr, hlim=255) / - scapy.ICMPv6ND_RA(retranstimer=validity_ms, + scapy.ICMPv6ND_RA(retranstimer=retranstimer, routerlifetime=routerlifetime) / scapy.ICMPv6NDOptSrcLLAddr(lladdr=macaddr) / scapy.ICMPv6NDOptPrefixInfo(prefix=cls.IPv6Prefix(netid), @@ -611,7 +617,7 @@ class MultiNetworkTest(net_test.NetworkTest): elif mode == "ucast_oif": self.SetUnicastInterface(s, self.ifindices.get(netid, 0)) else: - raise ValueError("Unkown interface selection mode %s" % mode) + raise ValueError("Unknown interface selection mode %s" % mode) def BuildSocket(self, version, constructor, netid, routing_mode): uid = self.UidForNetid(netid) if routing_mode == "uid" else None diff --git a/tests/net_test/run_net_test.sh b/tests/net_test/run_net_test.sh index a4ce0357..0ef1e2cd 100755 --- a/tests/net_test/run_net_test.sh +++ b/tests/net_test/run_net_test.sh @@ -7,6 +7,7 @@ OPTIONS="$OPTIONS NETFILTER NETFILTER_ADVANCED NETFILTER_XTABLES" OPTIONS="$OPTIONS NETFILTER_XT_MARK NETFILTER_XT_TARGET_MARK" OPTIONS="$OPTIONS IP_NF_IPTABLES IP_NF_MANGLE" OPTIONS="$OPTIONS IP6_NF_IPTABLES IP6_NF_MANGLE INET6_IPCOMP" +OPTIONS="$OPTIONS IPV6_PRIVACY IPV6_OPTIMISTIC_DAD" # For 3.1 kernels, where devtmpfs is not on by default. OPTIONS="$OPTIONS DEVTMPFS DEVTMPFS_MOUNT"