diff options
| author | 2020-07-08 05:29:53 +0000 | |
|---|---|---|
| committer | 2020-07-08 05:29:53 +0000 | |
| commit | fdf9d4afead48c12263007d42fd5579ae970d32e (patch) | |
| tree | 7616083e84f7b9dd65b9af89ceff6b032e6180d7 | |
| parent | 7da037e55ffde294795b7a1b096e1406a0d11b14 (diff) | |
| parent | f4f528d8ade6b940fdd9dfdc43971a4bffe47041 (diff) | |
Merge "Skip testPhysicalEthernet if the test run adb over network" am: 349c5720cf am: 8181ca516e am: 924a5e0680 am: f4f528d8ad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354445
Change-Id: I81aa71a22ad812d617b69733d7a7c12925496878
| -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(); |