summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-11-29 02:14:36 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-11-29 02:14:36 +0000
commit82bb8ad63dc156a5cd95c6d3b746119039fe3eb8 (patch)
tree0e0c96f7787ece630778d50231f671436e199621
parent36db950000d8007fd20ea371a288cfc412131b71 (diff)
parent01906fc8dd704f25814d9a56552c11364afc922f (diff)
downloadcts-82bb8ad63dc156a5cd95c6d3b746119039fe3eb8.tar.gz
Merge "Merge "Don't run the VPN tests on watches." into android13-tests-dev am: bda911054d" into android14-tests-dev am: de833dfcab am: 01906fc8dd
Original change: https://android-review.googlesource.com/c/platform/cts/+/2844056 Change-Id: I2158155c55255fb4ffcc3547412e2ea3aca33181 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
index 7aaacf39430..b66c2b42cd7 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
@@ -241,6 +241,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpn() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
installAppAsUser(VPN_APP_APK, userId);
executeDeviceTestClassNoRestrictBackground(".AlwaysOnVpnTest", userId);
@@ -253,6 +254,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnLockDown() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
installAppAsUser(VPN_APP_APK, userId);
try {
@@ -267,6 +269,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnAcrossReboot() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
try {
installAppAsUser(VPN_APP_APK, userId);
@@ -286,6 +289,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnPackageUninstalled() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
installAppAsUser(VPN_APP_APK, userId);
try {
@@ -303,6 +307,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnUnsupportedPackage() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
try {
// Target SDK = 23: unsupported
@@ -328,6 +333,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnUnsupportedPackageReplaced() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
try {
// Target SDK = 24: supported
@@ -350,6 +356,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@RequiresDevice
@Test
public void testAlwaysOnVpnPackageLogged() throws Exception {
+ assumeIsNotWatch();
int userId = getUserIdForAlwaysOnVpnTests();
// Will be uninstalled in tearDown().
installAppAsUser(VPN_APP_APK, userId);
@@ -598,7 +605,7 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
@Test
public void testSetMeteredDataDisabledPackages() throws Exception {
assumeHasWifiFeature();
- assumeFalse("is watch", hasDeviceFeature("android.hardware.type.watch"));
+ assumeIsNotWatch();
installAppAsUser(METERED_DATA_APP_APK, mUserId);
@@ -1567,4 +1574,8 @@ public abstract class DeviceAndProfileOwnerTest extends BaseDevicePolicyTest {
getDevice().executeShellCommand(
restricted ? RESTRICT_BACKGROUND_ON_CMD : RESTRICT_BACKGROUND_OFF_CMD);
}
+
+ private void assumeIsNotWatch() throws Exception {
+ assumeFalse("is watch", hasDeviceFeature("android.hardware.type.watch"));
+ }
}