add an integration test to verify DHCPv6 PD rebind for P flag.
Flag: EXEMPT test-only change Bug: 315069348 Test: atest FrameworksNetIntegrationTests Change-Id: Ie1413c6aef964b40eff05cc77c45d1324ad1ad6f
This commit is contained in:
parent
944bc19fbf
commit
fddcd51793
1 changed files with 33 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import android.platform.test.annotations.AppModeFull
|
|||
import android.provider.DeviceConfig.NAMESPACE_CONNECTIVITY
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.net.module.util.dhcp6.Dhcp6Packet
|
||||
import com.android.net.module.util.dhcp6.Dhcp6RebindPacket
|
||||
import com.android.net.module.util.dhcp6.Dhcp6SolicitPacket
|
||||
import com.android.testutils.AutoCloseTestInterfaceRule
|
||||
import com.android.testutils.DevSdkIgnoreRule
|
||||
|
|
@ -195,6 +196,38 @@ class Dhcp6PdTest {
|
|||
networkCallback.expect<Available>()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testProvisioning_triggeredByMultiplePrefixesWithPflag() {
|
||||
ndResponder.addRouterEntry(ROUTER_MAC, ROUTER_V6, RA_WITH_PFLAG)
|
||||
val (srcAddr, solicit) = expectDhcp6Packet<Dhcp6SolicitPacket>()
|
||||
|
||||
run {
|
||||
val ether = EtherPkt(src = ROUTER_MAC, dst = localMac)
|
||||
val ipv6 = Ip6Pkt(src = ROUTER_V6, dst = srcAddr)
|
||||
val udp = UdpPkt(sport = 547, dport = 546)
|
||||
val dhcp6 = Dhcp6Pkt(type = "REPLY", transId = solicit.transactionId)
|
||||
.addRapidCommitOption()
|
||||
.addClientIdentifierOption(solicit.clientDuid)
|
||||
.addServerIdentifierOption(byteArrayOf(1, 2, 3, 4, 5, 6))
|
||||
val dhcp6_pd = Dhcp6IaPdOpt(iaid = solicit.iaid)
|
||||
.addIaPrefixOption(prefix = "2001:db8:1234::/64")
|
||||
val pkt = ether / ipv6 / udp / dhcp6 / dhcp6_pd
|
||||
iface.sendPacket(pkt)
|
||||
}
|
||||
|
||||
networkCallback.expect<Available>()
|
||||
|
||||
run {
|
||||
val ether = EtherPkt(src = "f4:34:f0:64:52:fe", dst = "33:33:00:00:00:01")
|
||||
val ipv6 = Ip6Pkt(src = "fe80::12", dst = "ff02::1")
|
||||
val ra = RaPkt(lft = 360, retransTimer = 360)
|
||||
.addPioOption(prefix = "2002:db8:1::/64", flags = "LAP")
|
||||
iface.sendPacket(ether / ipv6 / ra)
|
||||
}
|
||||
|
||||
expectDhcp6Packet<Dhcp6RebindPacket>()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testProvisioning_withTwoPrefixes() {
|
||||
val ra = RaPkt()
|
||||
|
|
|
|||
Loading…
Reference in a new issue