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

Commit 9a28d985 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Gerrit Code Review
Browse files

Merge "Deflake doDualStackProvisioning"

parents e045c0d0 0a86750f
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1240,12 +1240,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()];