Merge "Exit test if device does not support IPsec tunnel" am: 32d03b84b6

Change-Id: I7c2e36102ec1020a74d323d098484cf035b50340
This commit is contained in:
Yan Yan
2020-05-21 23:23:34 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 3 deletions

View File

@@ -122,7 +122,9 @@ public class IkeSessionPskTest extends IkeSessionTestBase {
}
@Test
public void testIkeSessionSetupAndManageChildSas() throws Exception {
public void testIkeSessionSetupAndChildSessionSetupWithTunnelMode() throws Exception {
if (!hasTunnelsFeature()) return;
// Open IKE Session
IkeSession ikeSession = openIkeSession(createIkeSessionParams(mRemoteAddress));
int expectedMsgId = 0;
@@ -210,7 +212,9 @@ public class IkeSessionPskTest extends IkeSessionTestBase {
}
@Test
public void testIkeSessionKill() throws Exception {
public void testIkeSessionKillWithTunnelMode() throws Exception {
if (!hasTunnelsFeature()) return;
// Open IKE Session
IkeSession ikeSession = openIkeSession(createIkeSessionParams(mRemoteAddress));
int expectedMsgId = 0;
@@ -254,5 +258,7 @@ public class IkeSessionPskTest extends IkeSessionTestBase {
assertArrayEquals(EXPECTED_PROTOCOL_ERROR_DATA_NONE, protocolException.getErrorData());
}
// TODO(b/148689509): Verify rekey process and handling IKE_AUTH failure
// TODO(b/155821007): Verify rekey process and handling IKE_AUTH failure
// TODO(b/155821007): Test creating transport mode Child SA
}

View File

@@ -20,6 +20,7 @@ import static android.app.AppOpsManager.OP_MANAGE_IPSEC_TUNNELS;
import android.annotation.NonNull;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.InetAddresses;
import android.net.IpSecTransform;
@@ -368,6 +369,11 @@ abstract class IkeSessionTestBase extends IkeTestBase {
}
}
/** Package private method to check if device has IPsec tunnels feature */
static boolean hasTunnelsFeature() {
return sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS);
}
// TODO(b/148689509): Verify IKE Session setup using EAP and digital-signature-based auth
// TODO(b/148689509): Verify hostname based creation