summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Magic <kmagic@google.com>2021-10-11 19:49:46 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-10-11 19:49:46 +0000
commit974243270c377e78d41c05e0b92bb6ca60b72193 (patch)
tree01e0824a671ff60feca550c3e8599ca14204d263
parent051439cfb504b68e6b7970edf241592cd82d1d15 (diff)
parent41c4e8d7654b4dbb5efac136d72a556d9cb47dee (diff)
downloadcts-974243270c377e78d41c05e0b92bb6ca60b72193.tar.gz
Disables testDdmsWaitsForHandshake with native bridge. am: 41c4e8d765
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/16031785 Change-Id: If5dfec8433168c41139ddff365f08555e1d72d06
-rw-r--r--hostsidetests/jdwptunnel/src/android/jdwptunnel/cts/JdwpTunnelTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/hostsidetests/jdwptunnel/src/android/jdwptunnel/cts/JdwpTunnelTest.java b/hostsidetests/jdwptunnel/src/android/jdwptunnel/cts/JdwpTunnelTest.java
index 5fbc913b073..879160207f2 100644
--- a/hostsidetests/jdwptunnel/src/android/jdwptunnel/cts/JdwpTunnelTest.java
+++ b/hostsidetests/jdwptunnel/src/android/jdwptunnel/cts/JdwpTunnelTest.java
@@ -26,6 +26,7 @@ import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
+import com.android.tradefed.util.AbiUtils;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VirtualMachine;
@@ -41,6 +42,7 @@ import java.io.*;
import java.net.Socket;
import java.time.Instant;
import java.util.Map;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -269,6 +271,11 @@ public class JdwpTunnelTest extends BaseHostJUnit4Test {
}
}
+ private String getDeviceBaseArch() throws Exception {
+ String abi = mDevice.executeShellCommand("getprop ro.product.cpu.abi").replace("\n", "");
+ return AbiUtils.getBaseArchForAbi(abi);
+ }
+
/**
* Tests that we don't get any DDMS messages before the handshake.
*
@@ -277,6 +284,11 @@ public class JdwpTunnelTest extends BaseHostJUnit4Test {
*/
@Test
public void testDdmsWaitsForHandshake() throws DeviceNotAvailableException, Exception {
+ // Skip this test if not running on the device's native abi.
+ String testingArch = AbiUtils.getBaseArchForAbi(getAbi().getName());
+ String deviceArch = getDeviceBaseArch();
+ Assume.assumeTrue(testingArch.equals(deviceArch));
+
String port =
startupForwarding(DDMS_TEST_APP_PACKAGE_NAME, DDMS_TEST_APP_ACTIVITY_CLASS_NAME, false);
Socket sock = new Socket("localhost", Integer.decode(port).intValue());