summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-11-02 15:47:00 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-11-02 15:47:00 +0000
commitc0df84579b31bb373377c68f44f7023824577c7f (patch)
tree3926a846685f793c8c59b2475ed1611873f4bf47
parent6d3dcc53e77fb3c17a0c1743ac74e348580c702e (diff)
parent4ffd1d5f8c6740a918105e8f3ed6e927d2795ff3 (diff)
downloadcts-sparse-9247794-L78500000957231160.tar.gz
Merge "Merge cherrypicks of [2257642, 2270592, 2276847] into sparse-9158713-L12200000957170757." into sparse-9158713-L12200000957170757sparse-9247794-L82500000957238347sparse-9247794-L78500000957231160
-rw-r--r--hostsidetests/backup/src/android/cts/backup/ProfileScheduledJobHostSideTest.java24
-rw-r--r--tests/tests/hardware/src/android/hardware/input/cts/tests/InputTestCase.java6
-rw-r--r--tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualTouchscreenTest.java6
-rw-r--r--tools/cts-tradefed/res/config/cts-known-failures.xml3
4 files changed, 37 insertions, 2 deletions
diff --git a/hostsidetests/backup/src/android/cts/backup/ProfileScheduledJobHostSideTest.java b/hostsidetests/backup/src/android/cts/backup/ProfileScheduledJobHostSideTest.java
index 874282bc457..7e046213900 100644
--- a/hostsidetests/backup/src/android/cts/backup/ProfileScheduledJobHostSideTest.java
+++ b/hostsidetests/backup/src/android/cts/backup/ProfileScheduledJobHostSideTest.java
@@ -61,6 +61,10 @@ public class ProfileScheduledJobHostSideTest extends BaseMultiUserBackupHostSide
private static final int TIMEOUT_FOR_FULL_BACKUP_SECONDS = 5 * 60; // 5 minutes.
private static final String JOB_SCHEDULER_RUN_COMMAND = "cmd jobscheduler run -f android";
+ private static final String LOGCAT_BUFFER_SIZE_GET_COMMAND =
+ "logcat -g | grep -E -o '[0-9]*([[:space:]]KiB|[[:space:]]MiB)' | head -1";
+ private static final String LOGCAT_BUFFER_SIZE_SET_COMMAND = "logcat -G ";
+ private static final String LOGCAT_MAX_BUFFER_SIZE = "16MiB";
private final BackupUtils mBackupUtils = getBackupUtils();
private ITestDevice mDevice;
@@ -115,6 +119,14 @@ public class ProfileScheduledJobHostSideTest extends BaseMultiUserBackupHostSide
// Install a new key value backup app.
installPackageAsUser(KEY_VALUE_APK, profileUserId);
+ String previousBufferSize = mBackupUtils.executeShellCommandAndReturnOutput(
+ LOGCAT_BUFFER_SIZE_GET_COMMAND);
+ // Remove all whitespaces and non-visible characters
+ previousBufferSize = previousBufferSize.replaceAll("\\s+", "");
+
+ mBackupUtils.executeShellCommandSync(
+ LOGCAT_BUFFER_SIZE_SET_COMMAND + LOGCAT_MAX_BUFFER_SIZE);
+
// Force run k/v job.
String startLog = mLogcatInspector.mark(TAG);
int jobId = getJobIdForUser(KEY_VALUE_MIN_JOB_ID, profileUserId);
@@ -126,6 +138,8 @@ public class ProfileScheduledJobHostSideTest extends BaseMultiUserBackupHostSide
// Check job rescheduled.
assertThat(isSystemJobScheduled(jobId, KEY_VALUE_JOB_NAME)).isTrue();
+
+ mBackupUtils.executeShellCommandSync(LOGCAT_BUFFER_SIZE_SET_COMMAND + previousBufferSize);
}
/** Stop the profile user and assert that the key value job is no longer scheduled. */
@@ -165,6 +179,14 @@ public class ProfileScheduledJobHostSideTest extends BaseMultiUserBackupHostSide
installPackageAsUser(FULL_BACKUP_APK, profileUserId);
mBackupUtils.backupNowAndAssertSuccessForUser(PACKAGE_MANAGER_SENTINEL, profileUserId);
+ String previousBufferSize = mBackupUtils.executeShellCommandAndReturnOutput(
+ LOGCAT_BUFFER_SIZE_GET_COMMAND);
+ // Remove all whitespaces and non-visible characters
+ previousBufferSize = previousBufferSize.replaceAll("\\s+", "");
+
+ mBackupUtils.executeShellCommandSync(
+ LOGCAT_BUFFER_SIZE_SET_COMMAND + LOGCAT_MAX_BUFFER_SIZE);
+
// Force run full backup job.
String startLog = mLogcatInspector.mark(TAG);
int jobId = getJobIdForUser(FULL_BACKUP_MIN_JOB_ID, profileUserId);
@@ -176,6 +198,8 @@ public class ProfileScheduledJobHostSideTest extends BaseMultiUserBackupHostSide
// Check job rescheduled.
assertThat(isSystemJobScheduled(jobId, FULL_BACKUP_JOB_NAME)).isTrue();
+
+ mBackupUtils.executeShellCommandSync(LOGCAT_BUFFER_SIZE_SET_COMMAND + previousBufferSize);
}
/** Stop the profile user and assert that the full backup job is no longer scheduled. */
diff --git a/tests/tests/hardware/src/android/hardware/input/cts/tests/InputTestCase.java b/tests/tests/hardware/src/android/hardware/input/cts/tests/InputTestCase.java
index ddbb5f11338..63c6a76e47c 100644
--- a/tests/tests/hardware/src/android/hardware/input/cts/tests/InputTestCase.java
+++ b/tests/tests/hardware/src/android/hardware/input/cts/tests/InputTestCase.java
@@ -250,6 +250,11 @@ public abstract class InputTestCase {
}
protected void verifyEvents(List<InputEvent> events) {
+ verifyFirstEvents(events);
+ assertNoMoreEvents();
+ }
+
+ protected void verifyFirstEvents(List<InputEvent> events) {
// Make sure we received the expected input events
if (events.size() == 0) {
// If no event is expected we need to wait for event until timeout and fail on
@@ -276,7 +281,6 @@ public abstract class InputTestCase {
}
fail("Entry " + i + " is neither a KeyEvent nor a MotionEvent: " + event);
}
- assertNoMoreEvents();
}
private InputEvent waitForEvent() {
diff --git a/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualTouchscreenTest.java b/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualTouchscreenTest.java
index 8582b52c9a7..36d0237cca6 100644
--- a/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualTouchscreenTest.java
+++ b/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualTouchscreenTest.java
@@ -73,7 +73,11 @@ public class VirtualTouchscreenTest extends VirtualDeviceTestCase {
.build());
// Convert the input axis size to its equivalent fraction of the total screen.
final float computedSize = inputSize / (DISPLAY_WIDTH - 1f);
- verifyEvents(Arrays.asList(
+ // There's an extraneous ACTION_HOVER_ENTER event in builds before T QPR1. We fixed the
+ // related bug (b/244744917) so the hover event is not generated anymore. In order to make
+ // the test permissive to existing and new behaviors we only verify the first 2 events here.
+ // In U we should continue to use verifyEvents().
+ verifyFirstEvents(Arrays.asList(
createMotionEvent(MotionEvent.ACTION_DOWN, /* x= */ x, /* y= */ y,
/* pressure= */ 1f, /* size= */ computedSize, /* axisSize= */ inputSize),
createMotionEvent(MotionEvent.ACTION_UP, /* x= */ x, /* y= */ y,
diff --git a/tools/cts-tradefed/res/config/cts-known-failures.xml b/tools/cts-tradefed/res/config/cts-known-failures.xml
index a52f03f2fb0..c996bf5b497 100644
--- a/tools/cts-tradefed/res/config/cts-known-failures.xml
+++ b/tools/cts-tradefed/res/config/cts-known-failures.xml
@@ -293,4 +293,7 @@
<option name="compatibility:exclude-filter" value="CtsDevicePolicyManagerTestCases com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction" />
<option name="compatibility:exclude-filter" value="CtsDevicePolicyManagerTestCases com.android.cts.devicepolicy.ManagedProfileTest#testBluetoothSharingRestriction" />
+ <!-- b/249936107 -->
+ <option name="compatibility:exclude-filter" value="CtsTelephonyTestCases android.telephony.cts.SubscriptionManagerTest#testSubscriptionGroupingWithPermission" />
+ <option name="compatibility:exclude-filter" value="CtsTelephonyTestCases android.telephony.cts.SubscriptionManagerTest#testAddSubscriptionIntoNewGroupWithPermission" />
</configuration>