diff options
author | mukesh agrawal <quiche@google.com> | 2016-05-18 18:52:19 -0700 |
---|---|---|
committer | mukesh agrawal <quiche@google.com> | 2016-05-18 19:03:58 -0700 |
commit | 1bf155710ada7a6ee27453a120690d2c91a0fec5 (patch) | |
tree | 9212e2699d2ec193922efeedf405b16039a22b42 /tests | |
parent | 30c88d6ec01c9f871ac62c6c7038bc99c2a6f7d8 (diff) |
WifiLogger: fetch packet fate on dump()
We've observed that it's tricky to detect when a connection
fails. Consequently, even if the user is careful to generate
a bugreport while the device is in the failed state, the
bugreport will not include packet fate data for the most
recent connection.
Improve the utility of packet fate, by fetching the most
recent fate on the call to dump(). With this change in place,
we'll get packet fates for the most recent connection
attempt (even if it's still in progress).
BUG=28849396
TEST=unit tests, manual
Manual test
- configure bullhead for open network
- configure bullhead for wpa-2 network, wrong password
- let bullhead fail connecting to wpa-2 network
- let bullhead succeed connecting to open network
$ adb dumpsys > /tmp/dumpsys
$ grep 'fates ---' /tmp/dumpsys
--------------------- Last failed connection fates ----------------------
--------------------- Latest fates ----------------------
Change-Id: Iaeb2584020f70ac5d2f3139bac72ea07a7ddce81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java index e07c4b80b..2a30ffde4 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java @@ -298,20 +298,16 @@ public class WifiLoggerTest { verify(mWifiNative).getRxPktFates(anyObject()); } - /** - * Verifies that dump() does not synchronously fetch fates in release builds. (In debug builds, - * having dump() do an additional fetch makes it possible to test the feature with a fully - * working network.) - */ + /** Verifies that dump() fetches the latest fates. */ @Test - public void dumpDoesNotFetchFatesInReleaseBuild() { - final boolean verbosityToggle = true; + public void dumpFetchesFates() { + final boolean verbosityToggle = false; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); mWifiLogger.startLogging(verbosityToggle); mWifiLogger.dump(new FileDescriptor(), pw, new String[]{"bogus", "args"}); - verify(mWifiNative, never()).getTxPktFates(anyObject()); - verify(mWifiNative, never()).getRxPktFates(anyObject()); + verify(mWifiNative).getTxPktFates(anyObject()); + verify(mWifiNative).getRxPktFates(anyObject()); } /** @@ -340,12 +336,12 @@ public class WifiLoggerTest { final boolean verbosityToggle = true; mWifiLogger.startLogging(verbosityToggle); mWifiLogger.reportConnectionFailure(); + verify(mWifiNative).getTxPktFates(anyObject()); + verify(mWifiNative).getRxPktFates(anyObject()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); mWifiLogger.dump(new FileDescriptor(), pw, new String[]{"bogus", "args"}); - verify(mWifiNative).getTxPktFates(anyObject()); - verify(mWifiNative).getRxPktFates(anyObject()); String fateDumpString = sw.toString(); assertTrue(fateDumpString.contains("Last failed")); |