Make it possible to shut down and recreate IpClient in a test.
This is not currently possible because waitForRouterSolicitation only actually waits for an RS the first time it runs. This is because it returns immediately, without waiting, if a RS was received at any time since the test started. This was done because dual-stack provisioning tests were flaky, because getNextDhcpPacket would sometimes consume the RS. Fix this by making getNextDhcpPacket and getNextArpPacket use ReadHeads on the TapPacketReader, and going back to using poll in waitForRouterSolicitation. Given that waitForRouterSolicitation was the only user of TapPacketReader#getReceivedPackets, replace that method with a newReadHead function which seems easier to use. Bug: 161330494 Test: atest NetworkStackNextIntegrationTests:IpClientIntegrationTest Change-Id: I7f3ea4f21b80958f5704375ee7a0b17b25720d9d
Loading
Please register or sign in to comment