summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorErik Kline <ek@google.com>2014-10-14 15:52:37 +0900
committerLorenzo Colitti <lorenzo@google.com>2015-02-02 17:47:29 +0900
commitea56ba43a8234d545e8e22a09577850972764149 (patch)
tree2a9ec48de00f01b767e388c092920aba8bcfb8b9 /tests
parentaca272212f10365ab66891b43c535eed7ef63f72 (diff)
downloadextras-ea56ba43a8234d545e8e22a09577850972764149.tar.gz
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
Diffstat (limited to 'tests')
-rwxr-xr-xtests/net_test/mark_test.py12
-rwxr-xr-xtests/net_test/run_net_test.sh1
2 files changed, 10 insertions, 3 deletions
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"