Merge "add test for TetheringUtils::setupNsSocket()" am: d3bb5a544c am: b0c92ad6c8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1638165 Change-Id: If39dd7f5d6d4dbe1a0bbc487b743d6fbc360cd98
This commit is contained in:
committed by
Automerger Merge Worker
commit
d3bc95b1d2
@@ -167,6 +167,7 @@ public class TetheringUtilsTest {
|
||||
Inet6Address allRouters = NetworkStackConstants.IPV6_ADDR_ALL_ROUTERS_MULTICAST;
|
||||
|
||||
final ByteBuffer na = Ipv6Utils.buildNaPacket(mac1, mac2, ll1, ll2, 0, ll1);
|
||||
final ByteBuffer ns = Ipv6Utils.buildNsPacket(mac1, mac2, ll1, ll2, ll1);
|
||||
final ByteBuffer rs = Ipv6Utils.buildRsPacket(mac1, mac2, ll1, allRouters);
|
||||
|
||||
ByteBuffer received = checkIcmpSocketFilter(na /* passed */, rs /* dropped */,
|
||||
@@ -175,5 +176,12 @@ public class TetheringUtilsTest {
|
||||
Struct.parse(Ipv6Header.class, received); // Skip IPv6 header.
|
||||
Icmpv6Header icmpv6 = Struct.parse(Icmpv6Header.class, received);
|
||||
assertEquals(NetworkStackConstants.ICMPV6_NEIGHBOR_ADVERTISEMENT, icmpv6.type);
|
||||
|
||||
received = checkIcmpSocketFilter(ns /* passed */, rs /* dropped */,
|
||||
TetheringUtils::setupNsSocket);
|
||||
|
||||
Struct.parse(Ipv6Header.class, received); // Skip IPv6 header.
|
||||
icmpv6 = Struct.parse(Icmpv6Header.class, received);
|
||||
assertEquals(NetworkStackConstants.ICMPV6_NEIGHBOR_SOLICITATION, icmpv6.type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user