summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-06-19 10:27:30 -0700
committerRoshan Pius <rpius@google.com>2017-06-19 10:30:55 -0700
commit7130816d6c62e07d6d41150805515d7fd56f1f0d (patch)
tree4690f88e8a36c5e510479d7fa8b431476b30ff50 /tests
parentc0203e2c4ffeae355c88939fb180c2e1913c108d (diff)
WifiNative: Stop the Hal even if wificond stop fails
Changes in the CL: 1. Even if wificond.tearDownInterfaces() fails, we should still go ahead and attempt to the stop the hal. 2. WifiNative.tearDown()'s return value is unused currently. So, make it void. These are needed for the wifi stack to recover correctly from a wificond crash. Bug: 36586897 Test: Verified that we're able to connect back to a wifi network after triggering a wificond crash. Test: Unit tests Change-Id: Id5b3833b84d5d0a4016321f6c77757af8a3db009
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
index 2f13baf7b..d58af91fc 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
@@ -616,13 +616,27 @@ public class WifiNativeTest {
}
/**
- * Verifies that tearDownInterfaces() calls underlying WificondControl.
+ * Verifies that tearDownInterfaces() calls underlying WificondControl and WifiVendorHal
+ * methods.
*/
@Test
public void testTearDown() {
when(mWificondControl.tearDownInterfaces()).thenReturn(true);
- assertTrue(mWifiNative.tearDown());
+ mWifiNative.tearDown();
+ verify(mWificondControl).tearDownInterfaces();
+ verify(mWifiVendorHal).stopVendorHal();
+ }
+
+ /**
+ * Verifies that tearDownInterfaces() calls underlying WificondControl and WifiVendorHal
+ * methods even if wificond returns an error.
+ */
+ @Test
+ public void testTearDownWificondError() {
+ when(mWificondControl.tearDownInterfaces()).thenReturn(false);
+
+ mWifiNative.tearDown();
verify(mWificondControl).tearDownInterfaces();
verify(mWifiVendorHal).stopVendorHal();
}