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

Commit e145e066 authored by Benedict Wong's avatar Benedict Wong
Browse files

Call setUnderlyingNetwork to complete VCN MOBIKE

This change updates the underlying network for the VCN in order to
ensure full MOBIKE switches are handled.

Bug: 169788130
Test: atest FrameworksVcnTests
Change-Id: Ib439bde4217beeb28f425c08ed9f3376dfe0033c
parent 6adf88b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1478,7 +1478,7 @@ public class VcnGatewayConnection extends StateMachine {
                @NonNull IpSecTransform transform,
                int direction) {
            try {
                // TODO(b/180163196): Set underlying network of tunnel interface
                tunnelIface.setUnderlyingNetwork(underlyingNetwork);

                // Transforms do not need to be persisted; the IkeSession will keep them alive
                mIpSecManager.applyTunnelModeTransform(tunnelIface, direction, transform);
+8 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

@@ -143,11 +144,18 @@ public class VcnGatewayConnectionConnectedStateTest extends VcnGatewayConnection
                .onIpSecTransformsMigrated(makeDummyIpSecTransform(), makeDummyIpSecTransform());
        mTestLooper.dispatchAll();

        verify(mIpSecSvc, times(2))
                .setNetworkForTunnelInterface(
                        eq(TEST_IPSEC_TUNNEL_RESOURCE_ID),
                        eq(TEST_UNDERLYING_NETWORK_RECORD_1.network),
                        any());

        for (int direction : new int[] {DIRECTION_IN, DIRECTION_OUT}) {
            verify(mIpSecSvc)
                    .applyTunnelModeTransform(
                            eq(TEST_IPSEC_TUNNEL_RESOURCE_ID), eq(direction), anyInt(), any());
        }

        assertEquals(mGatewayConnection.mConnectedState, mGatewayConnection.getCurrentState());
    }