summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-10-03 08:37:55 -0700
committerRoshan Pius <rpius@google.com>2019-10-04 02:51:19 +0000
commit7836168c83b185a1d84d292df57a6e29299c0f76 (patch)
tree0d90b59d2a6f77b0c417712df72a2e022653e02f /tests
parentd3844c1a0602d6a4381c4ac695892f6e8f07f0c0 (diff)
WifiNetworkFactory: Remove network from config manager
Remove the network configuration from config manager once the processing of the request is complete. This will otherwise cause the next network request for the same network to reuse existing credentials. Bug: 141882562 Test: manual testing with the demo app. Test: atest com.android.server.wifi Test: Will send for regression testing. Change-Id: Id068aab8b48d87beee1edc12f074527850eadfd0
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java
index e23aa1254..a0c965a54 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java
@@ -1635,9 +1635,17 @@ public class WifiNetworkFactoryTest extends WifiBaseTest {
verify(mAlarmManager).cancel(mConnectionTimeoutAlarmListenerArgumentCaptor.getValue());
// Now release the network request.
+ WifiConfiguration wcmNetwork = new WifiConfiguration(mSelectedNetwork);
+ wcmNetwork.networkId = TEST_NETWORK_ID_1;
+ wcmNetwork.creatorUid = TEST_UID_1;
+ wcmNetwork.fromWifiNetworkSpecifier = true;
+ wcmNetwork.ephemeral = true;
+ when(mWifiConfigManager.getConfiguredNetwork(mSelectedNetwork.configKey()))
+ .thenReturn(wcmNetwork);
mWifiNetworkFactory.releaseNetworkFor(mNetworkRequest);
// Verify that we triggered a disconnect.
verify(mClientModeImpl, times(2)).disconnectCommand();
+ verify(mWifiConfigManager).removeNetwork(TEST_NETWORK_ID_1, TEST_UID_1);
// Re-enable connectivity manager .
verify(mWifiConnectivityManager).setSpecificNetworkRequestInProgress(false);
}