summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2018-07-03 15:12:43 -0700
committerxshu <xshu@google.com>2018-07-25 12:31:16 -0700
commitad4d342474ae1e54e4667d9f6a054d0c764a1c28 (patch)
tree5f4f82ef295d8ba119920826f9c0a55faf8e6673 /tests
parent1e04773bd080edc0cc281b8ece4d9bfd91190cf7 (diff)
Packet fate: create new event for timeout
These timeout messages that were added to solve a corner case for LastMileLogger is causing a regression on the packet fate logs. See the bug on why these timeouts are added in the first place. Specifically, every time 60s after CMD_START_CONNECT, a timeout would fire a CONNECTION_EVENT_FAILED in WifiDiagnostics. End result: "Last failed connection fates" is being updated 60s after start connect to whatever the latest packet fate data is. Instead of CONNECTION_EVENT_FAILED another event should be used since these timeouts always trigger and each connection failure is already explicitly dealt with.(association, authentication, ect.) This patch introduces a new event category: CONNECTION_EVENT_TIMEOUT to separate timeouts from actual connection failures. Bug: 111060673 Test: compile, unit tests Manual test: Flash Enter wrong password for authentication failure Run dumpsys wifi to see the "Last failed connection fates" printout Connect to GoogleGuest successfully Run dumpsys wifi to see both "Last failed connection fates" and "latest fates" printouts and note they are different. Wait 2 minutes to make sure the timeout message is processed Run dumpsys wifi and observe the "Last failed connection fates" log is not over written by the latest packet fates data. Change-Id: I83952eb1fbff7ae0911a9ba1bc377332a568d150
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java8
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java16
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java b/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
index bb26d01f1..769d67e34 100644
--- a/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
@@ -168,24 +168,24 @@ public class LastMileLoggerTest {
}
@Test
- public void connectionEventFailedDoesNotDisableTracingOnFailureOfStaleConnection()
+ public void connectionEventTimeoutDoesNotDisableTracingOnFailureOfStaleConnection()
throws Exception {
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
- FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_FAILED);
+ FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
assertEquals("1", IoUtils.readFileAsString(mTraceEnableFile.getPath()));
}
@Test
- public void connectionEventFailedDisablesTracingOnFailureOfFutureConnection()
+ public void connectionEventTimeoutDisablesTracingOnFailureOfFutureConnection()
throws Exception {
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
- FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_FAILED);
+ FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
assertEquals("0", IoUtils.readFileAsString(mTraceEnableFile.getPath()));
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
index 52cf65e93..7d0f2f196 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
@@ -391,6 +391,22 @@ public class WifiDiagnosticsTest {
verify(mWifiNative).getRxPktFates(any(), anyObject());
}
+ /**
+ * Verifies that we are not fetching packet fates for a CONNECTION_EVENT_TIMEOUT event
+ * and propagating it to LastMileLogger instead.
+ */
+ @Test
+ public void loggerSimplyPropagateEventTimeoutToLastMileLogger() {
+ final boolean verbosityToggle = true;
+ mWifiDiagnostics.startLogging(verbosityToggle);
+ mWifiDiagnostics.reportConnectionEvent(
+ FAKE_CONNECTION_ID, WifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
+ verify(mLastMileLogger).reportConnectionEvent(
+ FAKE_CONNECTION_ID, WifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
+ verify(mWifiNative, never()).getTxPktFates(any(), anyObject());
+ verify(mWifiNative, never()).getRxPktFates(any(), anyObject());
+ }
+
/** Verifies that dump() fetches the latest fates. */
@Test
public void dumpFetchesFates() {