diff options
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 0fd040c7e..597ccae7b 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -1024,10 +1024,12 @@ public class ClientModeImplTest { when(mDataTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_READY); String expectedAnonymousIdentity = TelephonyUtil.getAnonymousIdentityWith3GppRealm( mTelephonyManager); + // we are using anonymous@<realm> as our anonymous identity before connection + mConnectedNetwork.enterpriseConfig.setAnonymousIdentity(expectedAnonymousIdentity); + triggerConnect(); when(mCarrierNetworkConfig.isCarrierEncryptionInfoAvailable()).thenReturn(true); - when(mCarrierNetworkConfig.isSupportAnonymousIdentity()).thenReturn(true); when(mWifiConfigManager.getScanDetailCacheForNetwork(FRAMEWORK_NETWORK_ID)) .thenReturn(mScanDetailCache); @@ -1039,6 +1041,10 @@ public class ClientModeImplTest { mCmi.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, sBSSID); mLooper.dispatchAll(); + // verify that WifiNative#getEapAnonymousIdentity() was never called since we are using + // encrypted IMSI full authentication and not using pseudonym identity. + verify(mWifiNative, never()).getEapAnonymousIdentity(any()); + // check that the anonymous identity remains anonymous@<realm> for subsequent connections. assertEquals(expectedAnonymousIdentity, mConnectedNetwork.enterpriseConfig.getAnonymousIdentity()); } |