Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f386540e authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Automerger Merge Worker
Browse files

Merge "Deflake doDualStackProvisioning" am: 9a28d985 am: 398497e7 am:...

Merge "Deflake doDualStackProvisioning" am: 9a28d985 am: 398497e7 am: 4296878d am: 0f15cb0d am: 0623c9d3

Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1343436

Change-Id: Ide0c159c7e3ed16d036d4b7ff2426b70868bc4ee
parents 30e090ce 0623c9d3
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1239,12 +1239,16 @@ public class IpClientIntegrationTest {
                        == (byte) ICMPV6_ROUTER_SOLICITATION;
    }

    private void waitForRouterSolicitation() throws ParseException {
        byte[] packet;
        while ((packet = mPacketReader.popPacket(PACKET_TIMEOUT_MS)) != null) {
            if (isRouterSolicitation(packet)) return;
        }
        fail("No router solicitation received on interface within timeout");
    /**
     * Wait for any router solicitation to have arrived since the packet reader was received.
     *
     * This method does not affect packets obtained via mPacketReader.popPacket. After any router
     * solicitation has been received, calls to this method will just return immediately.
     */
    private void waitForRouterSolicitation() {
        assertNotNull("No router solicitation received on interface within timeout",
                mPacketReader.getReceivedPackets().poll(
                        PACKET_TIMEOUT_MS, 0 /* pos */, this::isRouterSolicitation));
    }

    private void sendRouterAdvertisement(boolean waitForRs, short lifetime) throws Exception {
+8 −0
Original line number Diff line number Diff line
@@ -72,6 +72,14 @@ public class TapPacketReader extends PacketReader {
        return mReadHead.getValue().poll(timeoutMs, filter::test);
    }

    /**
     * Get the {@link ArrayTrackRecord} that records all packets received by the reader since its
     * creation.
     */
    public ArrayTrackRecord<byte[]> getReceivedPackets() {
        return mReceivedPackets;
    }

    public void sendResponse(final ByteBuffer packet) throws IOException {
        try (FileOutputStream out = new FileOutputStream(mTapFd)) {
            byte[] packetBytes = new byte[packet.limit()];