diff options
| author | 2020-07-09 00:39:52 +0000 | |
|---|---|---|
| committer | 2020-07-09 00:39:52 +0000 | |
| commit | af774db022051ff69875d15c9dc16c9db13647da (patch) | |
| tree | c21208a94a0e36de2ccc6df96e400b6850c1f8a1 | |
| parent | 4d8720b45d928c5d324979906742f20d3e015d5f (diff) | |
| parent | a973bf1a567c6d7123b7c6ecb44e38f61f27b6d6 (diff) | |
Merge "Skip testPhysicalEthernet if the test run adb over network" into rvc-dev am: a973bf1a56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105761
Change-Id: Idd2f94df2e477b33db887d5d7c0d4aebf507cb86
| -rw-r--r-- | packages/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java b/packages/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java index 74df11370e50..e10bab4b36b5 100644 --- a/packages/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java +++ b/packages/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java @@ -42,6 +42,7 @@ import android.net.dhcp.DhcpPacket; import android.os.Handler; import android.os.HandlerThread; import android.os.SystemClock; +import android.os.SystemProperties; import android.system.Os; import android.util.Log; @@ -224,9 +225,19 @@ public class EthernetTetheringTest { } + private boolean isAdbOverNetwork() { + // If adb TCP port opened, this test may running by adb over network. + return (SystemProperties.getInt("persist.adb.tcp.port", -1) > -1) + || (SystemProperties.getInt("service.adb.tcp.port", -1) > -1); + } + @Test public void testPhysicalEthernet() throws Exception { assumeTrue(mEm.isAvailable()); + // Do not run this test if adb is over network and ethernet is connected. + // It is likely the adb run over ethernet, the adb would break when ethernet is switching + // from client mode to server mode. See b/160389275. + assumeFalse(isAdbOverNetwork()); // Get an interface to use. final String iface = mTetheredInterfaceRequester.getInterface(); |