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

Commit f47788f7 authored by Xiao Ma's avatar Xiao Ma Committed by Gerrit Code Review
Browse files

Merge "Fix the failure testCustomizedDhcpOptions_disallowedOption."

parents 0ef9f63b 45676f0f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -200,7 +200,8 @@ public abstract class DhcpPacket {
     * DHCP Optional Type: DHCP Interface MTU
     * DHCP Optional Type: DHCP Interface MTU
     */
     */
    public static final byte DHCP_MTU = 26;
    public static final byte DHCP_MTU = 26;
    protected Short mMtu;
    @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
    public Short mMtu;


    /**
    /**
     * DHCP Optional Type: DHCP BROADCAST ADDRESS
     * DHCP Optional Type: DHCP BROADCAST ADDRESS
+4 −3
Original line number Original line Diff line number Diff line
@@ -135,6 +135,7 @@ import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;


import com.android.internal.util.HexDump;
import com.android.internal.util.StateMachine;
import com.android.internal.util.StateMachine;
import com.android.net.module.util.ArrayTrackRecord;
import com.android.net.module.util.ArrayTrackRecord;
import com.android.net.module.util.Ipv6Utils;
import com.android.net.module.util.Ipv6Utils;
@@ -2748,8 +2749,8 @@ public abstract class IpClientIntegrationTestCommon {
        final List<DhcpOption> options = Arrays.asList(
        final List<DhcpOption> options = Arrays.asList(
                makeDhcpOption((byte) 60, TEST_OEM_VENDOR_ID.getBytes()),
                makeDhcpOption((byte) 60, TEST_OEM_VENDOR_ID.getBytes()),
                makeDhcpOption((byte) 77, TEST_OEM_USER_CLASS_INFO),
                makeDhcpOption((byte) 77, TEST_OEM_USER_CLASS_INFO),
                // DHCP_HOST_NAME
                // Option 26: MTU
                makeDhcpOption((byte) 12, new String("Pixel 3 XL").getBytes()));
                makeDhcpOption((byte) 26, HexDump.toByteArray(TEST_DEFAULT_MTU)));
        final ScanResultInfo info = makeScanResultInfo(0xdd /* vendor-specificIE */, TEST_OEM_OUI,
        final ScanResultInfo info = makeScanResultInfo(0xdd /* vendor-specificIE */, TEST_OEM_OUI,
                (byte) 0x17 /* vendor-specific IE type */);
                (byte) 0x17 /* vendor-specific IE type */);
        final DhcpPacket packet = doCustomizedDhcpOptionsTest(options, info);
        final DhcpPacket packet = doCustomizedDhcpOptionsTest(options, info);
@@ -2757,7 +2758,7 @@ public abstract class IpClientIntegrationTestCommon {
        assertTrue(packet instanceof DhcpDiscoverPacket);
        assertTrue(packet instanceof DhcpDiscoverPacket);
        assertEquals(packet.mVendorId, TEST_OEM_VENDOR_ID);
        assertEquals(packet.mVendorId, TEST_OEM_VENDOR_ID);
        assertArrayEquals(packet.mUserClass, TEST_OEM_USER_CLASS_INFO);
        assertArrayEquals(packet.mUserClass, TEST_OEM_USER_CLASS_INFO);
        assertNull(packet.mHostName);
        assertNull(packet.mMtu);
    }
    }


    @Test
    @Test