summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-09-11 15:07:48 -0700
committerNingyuan Wang <nywang@google.com>2017-09-11 15:57:55 -0700
commitee66ce102f8cf140394f71baea332eebb47ff4ae (patch)
treedbe0b3e4b5e9ce7af7b520daa6d9257e87183d92 /tests
parentbad0137ff3af9bb082382e57f0e2a4b5fbda6dbd (diff)
capture BR on wificond or HAL crashes
This allows us to save the most recent kernel logs when wificond or hal crashes. This saved log could help us debug underlying driver/kernel issues. Bug: 65550505 Bug: 64934608 Test: compile Test: run frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: manually kill wificond and take bugreport Find if there is a "Bug dump" section with "reason = 8" Change-Id: Id9311cee34b3fc25400e804bd96795c7f28f537a
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index c63db86e1..74c6b79ee 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -359,6 +359,7 @@ public class WifiStateMachineTest {
@Mock WrongPasswordNotifier mWrongPasswordNotifier;
@Mock Clock mClock;
@Mock ScanDetailCache mScanDetailCache;
+ @Mock WifiDiagnostics mWifiDiagnostics;
public WifiStateMachineTest() throws Exception {
}
@@ -383,8 +384,7 @@ public class WifiStateMachineTest {
when(mWifiInjector.getBuildProperties()).thenReturn(mBuildProperties);
when(mWifiInjector.getKeyStore()).thenReturn(mock(KeyStore.class));
when(mWifiInjector.getWifiBackupRestore()).thenReturn(mock(WifiBackupRestore.class));
- when(mWifiInjector.makeWifiDiagnostics(anyObject())).thenReturn(
- mock(BaseWifiDiagnostics.class));
+ when(mWifiInjector.makeWifiDiagnostics(anyObject())).thenReturn(mWifiDiagnostics);
when(mWifiInjector.makeWificond()).thenReturn(mWificond);
when(mWifiInjector.getWifiConfigManager()).thenReturn(mWifiConfigManager);
when(mWifiInjector.getWifiScanner()).thenReturn(mWifiScanner);
@@ -1753,6 +1753,7 @@ public class WifiStateMachineTest {
verify(mWifiMetrics).incrementNumHalCrashes();
verify(mSelfRecovery).trigger(eq(SelfRecovery.REASON_HAL_CRASH));
+ verify(mWifiDiagnostics).captureBugReportData(WifiDiagnostics.REPORT_REASON_HAL_CRASH);
}
@Test
@@ -1775,6 +1776,7 @@ public class WifiStateMachineTest {
verify(mWifiMetrics).incrementNumWificondCrashes();
verify(mSelfRecovery).trigger(eq(SelfRecovery.REASON_WIFICOND_CRASH));
+ verify(mWifiDiagnostics).captureBugReportData(WifiDiagnostics.REPORT_REASON_WIFICOND_CRASH);
}
private void setupMocksForWpsNetworkMigration() {