Merge "Stop skipping VPN tests when running ADB over TCP."
This commit is contained in:
@@ -727,11 +727,15 @@ public class VpnTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testDefault() throws Exception {
|
public void testDefault() throws Exception {
|
||||||
if (!supportedHardware()) return;
|
if (!supportedHardware()) return;
|
||||||
|
if (!SdkLevel.isAtLeastS() && (
|
||||||
|
SystemProperties.getInt("persist.adb.tcp.port", -1) > -1
|
||||||
|
|| SystemProperties.getInt("service.adb.tcp.port", -1) > -1)) {
|
||||||
// If adb TCP port opened, this test may running by adb over network.
|
// If adb TCP port opened, this test may running by adb over network.
|
||||||
// All of socket would be destroyed in this test. So this test don't
|
// All of socket would be destroyed in this test. So this test don't
|
||||||
// support adb over network, see b/119382723.
|
// support adb over network, see b/119382723.
|
||||||
if (SystemProperties.getInt("persist.adb.tcp.port", -1) > -1
|
// This is fixed in S, but still affects previous Android versions,
|
||||||
|| SystemProperties.getInt("service.adb.tcp.port", -1) > -1) {
|
// and this test must be backwards compatible.
|
||||||
|
// TODO: Delete this code entirely when R is no longer supported.
|
||||||
Log.i(TAG, "adb is running over the network, so skip this test");
|
Log.i(TAG, "adb is running over the network, so skip this test");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -842,11 +846,16 @@ public class VpnTest {
|
|||||||
FileDescriptor remoteFd = openSocketFdInOtherApp(TEST_HOST, 80, TIMEOUT_MS);
|
FileDescriptor remoteFd = openSocketFdInOtherApp(TEST_HOST, 80, TIMEOUT_MS);
|
||||||
|
|
||||||
String disallowedApps = mRemoteSocketFactoryClient.getPackageName() + "," + mPackageName;
|
String disallowedApps = mRemoteSocketFactoryClient.getPackageName() + "," + mPackageName;
|
||||||
|
if (!SdkLevel.isAtLeastS()) {
|
||||||
// If adb TCP port opened, this test may running by adb over TCP.
|
// If adb TCP port opened, this test may running by adb over TCP.
|
||||||
// Add com.android.shell appllication into blacklist to exclude adb socket for VPN test,
|
// Add com.android.shell application into disallowedApps to exclude adb socket for VPN
|
||||||
// see b/119382723.
|
// test, see b/119382723 (the test doesn't support adb over TCP when adb runs as root).
|
||||||
// Note: The test don't support running adb over network for root device
|
//
|
||||||
|
// This is fixed in S, but still affects previous Android versions,
|
||||||
|
// and this test must be backwards compatible.
|
||||||
|
// TODO: Delete this code entirely when R is no longer supported.
|
||||||
disallowedApps = disallowedApps + ",com.android.shell";
|
disallowedApps = disallowedApps + ",com.android.shell";
|
||||||
|
}
|
||||||
Log.i(TAG, "Append shell app to disallowedApps: " + disallowedApps);
|
Log.i(TAG, "Append shell app to disallowedApps: " + disallowedApps);
|
||||||
startVpn(new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"},
|
startVpn(new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"},
|
||||||
new String[] {"192.0.2.0/24", "2001:db8::/32"},
|
new String[] {"192.0.2.0/24", "2001:db8::/32"},
|
||||||
@@ -930,11 +939,17 @@ public class VpnTest {
|
|||||||
if (!supportedHardware()) return;
|
if (!supportedHardware()) return;
|
||||||
ProxyInfo initialProxy = mCM.getDefaultProxy();
|
ProxyInfo initialProxy = mCM.getDefaultProxy();
|
||||||
|
|
||||||
|
String disallowedApps = mPackageName;
|
||||||
|
if (!SdkLevel.isAtLeastS()) {
|
||||||
// If adb TCP port opened, this test may running by adb over TCP.
|
// If adb TCP port opened, this test may running by adb over TCP.
|
||||||
// Add com.android.shell appllication into blacklist to exclude adb socket for VPN test,
|
// Add com.android.shell application into disallowedApps to exclude adb socket for VPN
|
||||||
// see b/119382723.
|
// test, see b/119382723 (the test doesn't support adb over TCP when adb runs as root).
|
||||||
// Note: The test don't support running adb over network for root device
|
//
|
||||||
String disallowedApps = mPackageName + ",com.android.shell";
|
// This is fixed in S, but still affects previous Android versions,
|
||||||
|
// and this test must be backwards compatible.
|
||||||
|
// TODO: Delete this code entirely when R is no longer supported.
|
||||||
|
disallowedApps += ",com.android.shell";
|
||||||
|
}
|
||||||
ProxyInfo testProxyInfo = ProxyInfo.buildDirectProxy("10.0.0.1", 8888);
|
ProxyInfo testProxyInfo = ProxyInfo.buildDirectProxy("10.0.0.1", 8888);
|
||||||
startVpn(new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"},
|
startVpn(new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"},
|
||||||
new String[] {"0.0.0.0/0", "::/0"}, "", disallowedApps,
|
new String[] {"0.0.0.0/0", "::/0"}, "", disallowedApps,
|
||||||
|
|||||||
Reference in New Issue
Block a user