summaryrefslogtreecommitdiff
path: root/test/com/google/android
diff options
context:
space:
mode:
authorKuen Yuet Cheung <kuenyuet@google.com>2023-09-15 18:06:09 +0800
committerKuen Yuet Cheung <kuenyuet@google.com>2023-09-20 14:33:41 +0800
commit4b6d12aca9660b9ef84ab4cb0e39b620b556a693 (patch)
treee411bc0ca9c17881c02adb885963e3bb9024a488 /test/com/google/android
parent42f2fd18e73bbe7667cb6305b7b0cd66c09fbd77 (diff)
downloadIwlan-4b6d12aca9660b9ef84ab4cb0e39b620b556a693.tar.gz
Keep the RetryIndex if the Error is IKE Protocol Exception
Test: atest Bug: 292312000 Change-Id: I722f543de2ab6ce94410c7be1ce58528ae762626
Diffstat (limited to 'test/com/google/android')
-rw-r--r--test/com/google/android/iwlan/ErrorPolicyManagerTest.java47
1 files changed, 39 insertions, 8 deletions
diff --git a/test/com/google/android/iwlan/ErrorPolicyManagerTest.java b/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
index f9ec9fa..8732e42 100644
--- a/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
+++ b/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
@@ -244,18 +244,13 @@ public class ErrorPolicyManagerTest {
assertEquals(4, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(8, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(16, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(86400, time);
// Validate the range error detail.
+ // TODO: b/292312000 - IKE Protocol Error Keep RetryIndex Workaround
+ // IKE Protocol Error will keep the RetryIndex. Although a new error with
+ // different error code reported, timer will not start at RetryIndex 0
iwlanError = buildIwlanIkeProtocolError(9030, new byte[] {0x00, 0x01});
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(4, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(8, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(16, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(86400, time);
@@ -269,6 +264,18 @@ public class ErrorPolicyManagerTest {
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(86400, time);
+ // Fallback case IKE_INIT_TIMEOUT and retryArray is 1, 2, 2, 10, 20
+ // Should start at RetryIndex 0
+ iwlanError = new IwlanError(IwlanError.IKE_INIT_TIMEOUT);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(1, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(2, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(2, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(10, time);
+
// Fallback case GENERIC_PROTOCOL_ERROR_TYPE(44) and retryArray is 5, 10, -1 as in
// DEFAULT_CONFIG
iwlanError = buildIwlanIkeChildSaNotFoundError();
@@ -327,6 +334,14 @@ public class ErrorPolicyManagerTest {
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(80, time);
+ // TODO: b/292312000 - IKE Protocol Error Keep RetryIndex Workaround
+ // Use APM_ENABLE_EVENT to reset the RetryIndex
+ mErrorPolicyManager
+ .mHandler
+ .obtainMessage(IwlanEventListener.APM_ENABLE_EVENT)
+ .sendToTarget();
+ mTestLooper.dispatchAll();
+
iwlanError = buildIwlanIkeProtocolError(9002);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(5, time);
@@ -341,6 +356,14 @@ public class ErrorPolicyManagerTest {
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(80, time);
+ // TODO: b/292312000 - IKE Protocol Error Keep RetryIndex Workaround
+ // Use APM_ENABLE_EVENT to reset the RetryIndex
+ mErrorPolicyManager
+ .mHandler
+ .obtainMessage(IwlanEventListener.APM_ENABLE_EVENT)
+ .sendToTarget();
+ mTestLooper.dispatchAll();
+
iwlanError = buildIwlanIkeInternalAddressFailure();
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(0, time);
@@ -401,6 +424,14 @@ public class ErrorPolicyManagerTest {
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(86400, time);
+ // TODO: b/292312000 - IKE Protocol Error Keep RetryIndex Workaround
+ // Use APM_ENABLE_EVENT to reset the RetryIndex
+ mErrorPolicyManager
+ .mHandler
+ .obtainMessage(IwlanEventListener.APM_ENABLE_EVENT)
+ .sendToTarget();
+ mTestLooper.dispatchAll();
+
// IKE_PROTOCOL_ERROR_TYPE(44) and retryArray = 0 as it will fallback to
// IKE_PROTOCOL_ERROR_TYPE generic fallback first.
iwlanError = buildIwlanIkeChildSaNotFoundError();