summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-12 15:46:06 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-12 15:46:06 +0000
commit4eafcf913e93c321e0af2742d3575da5050929f5 (patch)
tree7bf38a7018719fd4abfd082e1a493a1cbf9c5cf3
parenta742a4a591c3dd21bb449c4d74063865e8267cfd (diff)
parent40a3e632ef018b8de010215c36e1228df4e79160 (diff)
downloadcatbox-android12-mainline-neuralnetworks-release.tar.gz
Snap for 7910331 from 40a3e632ef018b8de010215c36e1228df4e79160 to mainline-neuralnetworks-releaseandroid-mainline-12.0.0_r92android-mainline-12.0.0_r78android-mainline-12.0.0_r50android12-mainline-neuralnetworks-release
Change-Id: I9249bc0c77c8630e2b73a718d166fde92847680d
-rw-r--r--OWNERS6
-rw-r--r--report/Android.bp25
-rw-r--r--report/src/com/android/catbox/result/JsonResultReporter.java348
-rw-r--r--report/src/com/android/catbox/util/TestMetricsUtil.java271
-rw-r--r--tools/catbox-tradefed/Android.bp2
-rw-r--r--tools/catbox-tradefed/etc/catbox-tradefed4
-rw-r--r--tools/catbox-tradefed/res/config/catbox-common.xml10
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-app-info-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-appgrid.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-bluetooth-audio.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-date-time-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-home.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-lock-screen.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-navigation-bar.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-network-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-security-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-setting.xml3
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-sound-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-system-setting.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-functional-ux-restriction.xml33
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-app-start-up-base.xml3
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-base.xml20
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-dialer.xml52
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-mediacenter.xml52
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-settings.xml12
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-guest.xml41
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-user.xml38
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-guest.xml38
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-user.xml38
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-dialer.xml52
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-mediacenter.xml52
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-settings.xml12
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-jank-appgrid.xml50
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-jank-base.xml3
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-jank-contact-list.xml50
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-jank-notifications.xml50
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-jank-settings.xml12
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-multiuser-base.xml39
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-postprocessors.xml3
-rw-r--r--tools/catbox-tradefed/res/config/catbox-performance-switch-to-existing-user.xml29
-rw-r--r--tools/catbox-tradefed/res/config/catbox-preparer.xml4
41 files changed, 1693 insertions, 22 deletions
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..5270c1a
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 945967
+# OWNERS of CATBox Repo
+schinchalkar@google.com
+smara@google.com
+tongfei@google.com
+zhaomingyin@google.com \ No newline at end of file
diff --git a/report/Android.bp b/report/Android.bp
new file mode 100644
index 0000000..d4b0d25
--- /dev/null
+++ b/report/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_library_host {
+ name: "catbox-report-lib",
+ srcs: ["src/**/*.java"],
+ libs: [
+ "tradefed",
+ "loganalysis",
+ "tools-common-prebuilt",
+ "compatibility-tradefed",
+ "compatibility-host-util",
+ ]
+} \ No newline at end of file
diff --git a/report/src/com/android/catbox/result/JsonResultReporter.java b/report/src/com/android/catbox/result/JsonResultReporter.java
new file mode 100644
index 0000000..6e9b9c3
--- /dev/null
+++ b/report/src/com/android/catbox/result/JsonResultReporter.java
@@ -0,0 +1,348 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.catbox.result;
+
+import com.android.annotations.VisibleForTesting;
+
+import com.android.catbox.util.TestMetricsUtil;
+
+import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
+import com.android.compatibility.common.tradefed.util.CollectorUtil;
+import com.android.compatibility.common.util.MetricsReportLog;
+import com.android.compatibility.common.util.ResultType;
+import com.android.compatibility.common.util.ResultUnit;
+
+import com.android.ddmlib.Log.LogLevel;
+
+import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.config.Option;
+import com.android.tradefed.config.OptionClass;
+import com.android.tradefed.invoker.IInvocationContext;
+
+import com.android.tradefed.log.LogUtil.CLog;
+
+import com.android.tradefed.metrics.proto.MetricMeasurement.Metric;
+
+import com.android.tradefed.result.ITestInvocationListener;
+import com.android.tradefed.result.TestDescription;
+
+import com.android.tradefed.testtype.suite.ModuleDefinition;
+
+import com.android.tradefed.util.FileUtil;
+import com.android.tradefed.util.proto.TfMetricProtoUtil;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** JsonResultReporter aggregates and writes performance test metrics to a Json file. */
+@OptionClass(alias = "json-result-reporter")
+public class JsonResultReporter implements ITestInvocationListener {
+ private CompatibilityBuildHelper mBuildHelper;
+ private IInvocationContext mContext;
+ private IInvocationContext mModuleContext;
+ private IBuildInfo mBuildInfo;
+ private TestMetricsUtil mTestMetricsUtil;
+
+ @Option(
+ name = "dest-dir",
+ description =
+ "The directory under the result to store the files. "
+ + "Default to 'report-log-files'.")
+ private String mDestDir = "report-log-files";
+
+ private String mTempReportFolder = "temp-report-logs";
+
+ @Option(name = "report-log-name", description = "Name of the JSON report file.")
+ private String mReportLogName = null;
+
+ @Option(
+ name = "report-test-name-mapping",
+ description = "Mapping for test name to use in report.")
+ private Map<String, String> mReportTestNameMap = new HashMap<String, String>();
+
+ @Option(
+ name = "report-all-metrics",
+ description = "Report all the generated metrics. Default to 'true'.")
+ private boolean mReportAllMetrics = true;
+
+ @Option(
+ name = "report-metric-key-mapping",
+ description =
+ "Mapping for Metric Keys to be reported. "
+ + "Only report the keys provided in the mapping.")
+ private Map<String, String> mReportMetricKeyMap = new HashMap<String, String>();
+
+ @Option(name = "test-iteration-separator", description = "Separator used in between the test"
+ + " class name and the iteration number. Default separator is '$'")
+ private String mTestIterationSeparator = "$";
+
+ @Option(name = "aggregate-similar-tests", description = "To aggregate the metrics from test"
+ + " cases which differ only by iteration number or having the same test name."
+ + " Used only in context with the microbenchmark test runner. Set this flag to false"
+ + " to disable aggregating the metrics.")
+ private boolean mAggregateSimilarTests = false;
+
+ public JsonResultReporter() {
+ // Default Constructor
+ // Nothing to do
+ }
+
+ /**
+ * Return the primary build info that was reported via {@link
+ * #invocationStarted(IInvocationContext)}. Primary build is the build returned by the first
+ * build provider of the running configuration. Returns null if there is no context (no build to
+ * test case).
+ */
+ private IBuildInfo getPrimaryBuildInfo() {
+ if (mContext == null) {
+ return null;
+ } else {
+ return mContext.getBuildInfos().get(0);
+ }
+ }
+
+ /** Create Build Helper */
+ @VisibleForTesting
+ CompatibilityBuildHelper createBuildHelper() {
+ return new CompatibilityBuildHelper(getPrimaryBuildInfo());
+ }
+
+ /** Get Device ABI Information */
+ @VisibleForTesting
+ String getAbiInfo() {
+ CLog.logAndDisplay(LogLevel.INFO, "Getting ABI Information.");
+ if (mModuleContext == null) {
+ // Return Empty String
+ return "";
+ }
+ List<String> abis = mModuleContext.getAttributes().get(ModuleDefinition.MODULE_ABI);
+ if (abis == null || abis.isEmpty()) {
+ // Return Empty String
+ return "";
+ }
+ if (abis.size() > 1) {
+ CLog.logAndDisplay(
+ LogLevel.WARN,
+ String.format(
+ "More than one ABI name specified (using first one): %s",
+ abis.toString()));
+ }
+ return abis.get(0);
+ }
+
+ /** Initialize Test Metrics Util */
+ @VisibleForTesting
+ TestMetricsUtil initializeTestMetricsUtil() {
+ return new TestMetricsUtil();
+ }
+
+ /** Initialize configurations for Result Reporter */
+ private void initializeReporterConfig() {
+ CLog.logAndDisplay(LogLevel.INFO, "Initializing Test Metrics Result Reporter Config.");
+ // Initialize Build Info
+ mBuildInfo = getPrimaryBuildInfo();
+
+ // Initialize Build Helper
+ if (mBuildHelper == null) {
+ mBuildHelper = createBuildHelper();
+ }
+
+ // Initialize Report Log Name
+ // Use test tag as the report name if not provided
+ if (mReportLogName == null) {
+ mReportLogName = mContext.getTestTag();
+ }
+
+ // Initialize Test Metrics Util
+ if (mTestMetricsUtil == null) {
+ mTestMetricsUtil = initializeTestMetricsUtil();
+ }
+ mTestMetricsUtil.setIterationSeparator(mTestIterationSeparator);
+ }
+
+ /** Write Test Metrics to JSON */
+ private void writeTestMetrics(
+ String classMethodName, Map<String, String> metrics) {
+
+ // Use class method name as stream name if mapping is not provided
+ String streamName = classMethodName;
+ if (mReportTestNameMap != null && mReportTestNameMap.containsKey(classMethodName)) {
+ streamName = mReportTestNameMap.get(classMethodName);
+ }
+
+ // Get ABI Info
+ String abiName = getAbiInfo();
+
+ // Initialize Metrics Report Log
+ // TODO: b/194103027 [Remove MetricsReportLog dependency as it is being deprecated].
+ MetricsReportLog reportLog =
+ new MetricsReportLog(
+ mBuildInfo, abiName, classMethodName, mReportLogName, streamName);
+
+ // Write Test Metrics in the Log
+ if (mReportAllMetrics) {
+ // Write all the metrics to the report
+ writeAllMetrics(reportLog, metrics);
+ } else {
+ // Write metrics for given keys to the report
+ writeMetricsForGivenKeys(reportLog, metrics);
+ }
+
+ // Submit Report Log
+ reportLog.submit();
+ }
+
+ /** Write all the metrics to JSON Report */
+ private void writeAllMetrics(MetricsReportLog reportLog, Map<String, String> metrics) {
+ CLog.logAndDisplay(LogLevel.INFO, "Writing all the metrics to JSON report.");
+ for (String key : metrics.keySet()) {
+ try {
+ double value = Double.parseDouble(metrics.get(key));
+ reportLog.addValue(key, value, ResultType.NEUTRAL, ResultUnit.NONE);
+ } catch (NumberFormatException exception) {
+ CLog.logAndDisplay(
+ LogLevel.ERROR,
+ String.format(
+ "Unable to parse value '%s' for '%s' metric key.",
+ metrics.get(key), key));
+ }
+ }
+ CLog.logAndDisplay(
+ LogLevel.INFO, "Successfully completed writing the metrics to JSON report.");
+ }
+
+ /** Write given set of metrics to JSON Report */
+ private void writeMetricsForGivenKeys(
+ MetricsReportLog reportLog, Map<String, String> metrics) {
+ CLog.logAndDisplay(LogLevel.INFO, "Writing given set of metrics to JSON report.");
+ if (mReportMetricKeyMap == null || mReportMetricKeyMap.isEmpty()) {
+ CLog.logAndDisplay(
+ LogLevel.WARN, "Skip reporting metrics. Metric keys are not provided.");
+ return;
+ }
+ for (String key : mReportMetricKeyMap.keySet()) {
+ if (!metrics.containsKey(key) || metrics.get(key) == null) {
+ CLog.logAndDisplay(LogLevel.WARN, String.format("%s metric key is missing.", key));
+ continue;
+ }
+ try {
+ double value = Double.parseDouble(metrics.get(key));
+ reportLog.addValue(
+ mReportMetricKeyMap.get(key), value, ResultType.NEUTRAL, ResultUnit.NONE);
+ } catch (NumberFormatException exception) {
+ CLog.logAndDisplay(
+ LogLevel.ERROR,
+ String.format(
+ "Unable to parse value '%s' for '%s' metric key.",
+ metrics.get(key), key));
+ }
+ }
+ CLog.logAndDisplay(
+ LogLevel.INFO, "Successfully completed writing the metrics to JSON report.");
+ }
+
+ /** Copy the report generated at temporary path to the given destination path in Results */
+ private void copyGeneratedReportToResultsDirectory() {
+ CLog.logAndDisplay(LogLevel.INFO, "Copying the report log to results directory.");
+ // Copy report log files to results dir.
+ try {
+ // Get Result Directory
+ File resultDir = mBuildHelper.getResultDir();
+ // Create a directory ( if it does not exist ) in results for report logs
+ if (mDestDir != null) {
+ resultDir = new File(resultDir, mDestDir);
+ }
+ if (!resultDir.exists()) {
+ resultDir.mkdirs();
+ }
+ if (!resultDir.isDirectory()) {
+ CLog.logAndDisplay(
+ LogLevel.ERROR,
+ String.format("%s is not a directory", resultDir.getAbsolutePath()));
+ return;
+ }
+ // Temp directory for report logs
+ final File hostReportDir = FileUtil.createNamedTempDir(mTempReportFolder);
+ if (!hostReportDir.isDirectory()) {
+ CLog.logAndDisplay(
+ LogLevel.ERROR,
+ String.format("%s is not a directory", hostReportDir.getAbsolutePath()));
+ return;
+ }
+ // Copy the report logs from temp directory and to the results directory
+ CollectorUtil.pullFromHost(hostReportDir, resultDir);
+ CollectorUtil.reformatRepeatedStreams(resultDir);
+ CLog.logAndDisplay(LogLevel.INFO, "Copying the report log completed successfully.");
+ } catch (IOException exception) {
+ CLog.logAndDisplay(LogLevel.ERROR, exception.getMessage());
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void invocationStarted(IInvocationContext context) {
+ mContext = context;
+ initializeReporterConfig();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void invocationEnded(long elapsedTime) {
+ // Copy the generated report to Results Directory
+ copyGeneratedReportToResultsDirectory();
+ }
+
+ /** Overrides parent to explicitly to store test metrics */
+ @Override
+ public void testEnded(TestDescription testDescription, HashMap<String, Metric> metrics) {
+ // If metrics are available and aggregate-similar-metrics is set to true, store the metrics
+ if (metrics != null && !metrics.isEmpty() && mAggregateSimilarTests) {
+ // Store the metrics
+ mTestMetricsUtil.storeTestMetrics(testDescription, metrics);
+ }
+ }
+
+ /** Overrides parent to explicitly to process and write metrics */
+ @Override
+ public final void testRunEnded(long elapsedTime, HashMap<String, Metric> runMetrics) {
+ // If aggregate-similar-metrics is set to true, aggregate the metrics
+ if (mAggregateSimilarTests) {
+ // Aggregate Metrics for Similar Tests and write to the file
+ Map<String, Map<String, String>> aggregatedMetrics =
+ mTestMetricsUtil.getAggregatedStoredTestMetrics();
+ for (String testName: aggregatedMetrics.keySet()) {
+ writeTestMetrics(testName, aggregatedMetrics.get(testName));
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void testModuleStarted(IInvocationContext moduleContext) {
+ mModuleContext = moduleContext;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void testModuleEnded() {
+ mModuleContext = null;
+ }
+}
diff --git a/report/src/com/android/catbox/util/TestMetricsUtil.java b/report/src/com/android/catbox/util/TestMetricsUtil.java
new file mode 100644
index 0000000..e801335
--- /dev/null
+++ b/report/src/com/android/catbox/util/TestMetricsUtil.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.catbox.util;
+
+import com.android.annotations.VisibleForTesting;
+
+import com.android.ddmlib.Log.LogLevel;
+
+import com.android.tradefed.log.LogUtil.CLog;
+import com.android.tradefed.metrics.proto.MetricMeasurement.DataType;
+import com.android.tradefed.metrics.proto.MetricMeasurement.Measurements;
+import com.android.tradefed.metrics.proto.MetricMeasurement.Metric;
+import com.android.tradefed.result.TestDescription;
+import com.android.tradefed.util.proto.TfMetricProtoUtil;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.math.Quantiles;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * Contains common utility methods for storing the test metrics and aggregating the metrics in
+ * similar tests.
+ */
+public class TestMetricsUtil {
+
+ private static final String TEST_HEADER_SEPARATOR = "\n\n";
+ private static final String METRIC_SEPARATOR = "\n";
+ private static final String METRIC_KEY_VALUE_SEPARATOR = ":";
+ private static final String STATS_KEY_MIN = "min";
+ private static final String STATS_KEY_MAX = "max";
+ private static final String STATS_KEY_MEAN = "mean";
+ private static final String STATS_KEY_VAR = "var";
+ private static final String STATS_KEY_STDEV = "stdev";
+ private static final String STATS_KEY_MEDIAN = "median";
+ private static final String STATS_KEY_TOTAL = "total";
+ private static final String STATS_KEY_COUNT = "metric-count";
+ private static final String STATS_KEY_PERCENTILE_PREFIX = "p";
+ private static final String STATS_KEY_SEPARATOR = "-";
+ private static final Joiner CLASS_METHOD_JOINER = Joiner.on("#").skipNulls();
+
+ // Used to separate the package name from the iteration number. Default is set to "$".
+ private String mTestIterationSeparator = "$";
+
+ // Percentiles to include when calculating the aggregates.
+ private Set<Integer> mActualPercentiles = new HashSet<>();
+
+ // Store the test metrics for aggregation at the end of test run.
+ // Outer map key is the test id and inner map key is the metric key name.
+ private Map<String, ArrayListMultimap<String, Metric>> mStoredTestMetrics =
+ new HashMap<String, ArrayListMultimap<String, Metric>>();
+
+ /**
+ * Used for storing the individual test metrics and use it for aggregation.
+ */
+ public void storeTestMetrics(TestDescription testDescription, Map<String, Metric> testMetrics) {
+ if (testMetrics == null) {
+ return;
+ }
+
+ // Group test cases which differs only by the iteration separator or test the same name.
+ String className = testDescription.getClassName();
+ int iterationSeparatorIndex = testDescription.getClassName()
+ .indexOf(mTestIterationSeparator);
+ if (iterationSeparatorIndex != -1) {
+ className = testDescription.getClassName().substring(0, iterationSeparatorIndex);
+ }
+ String newTestId = CLASS_METHOD_JOINER.join(className, testDescription.getTestName());
+
+ if (!mStoredTestMetrics.containsKey(newTestId)) {
+ mStoredTestMetrics.put(newTestId, ArrayListMultimap.create());
+ }
+ ArrayListMultimap<String, Metric> storedMetricsForThisTest = mStoredTestMetrics
+ .get(newTestId);
+
+ // Store only raw metrics
+ HashMap<String, Metric> rawMetrics = getRawMetricsOnly(testMetrics);
+
+ for (Map.Entry<String, Metric> entry : rawMetrics.entrySet()) {
+ String key = entry.getKey();
+ // In case of Multi User test, the metric conatins className with iteration separator
+ if (key.indexOf(mTestIterationSeparator) != -1 &&
+ key.contains(testDescription.getClassName())) {
+ key = key.substring(0, key.indexOf(mTestIterationSeparator));
+ key = CLASS_METHOD_JOINER.join(key, testDescription.getTestName());
+ }
+ storedMetricsForThisTest.put(key, entry.getValue());
+ }
+ }
+
+ /**
+ * Aggregate the metrics collected from multiple iterations of the test and
+ * return aggregated metrics.
+ */
+ public Map<String, Map<String, String>> getAggregatedStoredTestMetrics() {
+ Map<String, Map<String, String>> aggregatedStoredMetrics =
+ new HashMap<String, Map<String, String>>();
+ for (String testName : mStoredTestMetrics.keySet()) {
+ ArrayListMultimap<String, Metric> currentTest = mStoredTestMetrics.get(testName);
+
+ Map<String, Metric> aggregateMetrics = new LinkedHashMap<String, Metric>();
+ for (String metricKey : currentTest.keySet()) {
+ List<Metric> metrics = currentTest.get(metricKey);
+ List<Measurements> measures = metrics.stream().map(Metric::getMeasurements)
+ .collect(Collectors.toList());
+ // Parse metrics into a list of SingleString values, concating lists in the process
+ List<String> rawValues = measures.stream()
+ .map(Measurements::getSingleString)
+ .map(
+ m -> {
+ // Split results; also deals with the case of empty results
+ // in a certain run
+ List<String> splitVals = Arrays.asList(m.split(",", 0));
+ if (splitVals.size() == 1 && splitVals.get(0).isEmpty()) {
+ return Collections.<String> emptyList();
+ }
+ return splitVals;
+ })
+ .flatMap(Collection::stream)
+ .map(String::trim)
+ .collect(Collectors.toList());
+ // Do not report empty metrics
+ if (rawValues.isEmpty()) {
+ continue;
+ }
+ if (isAllDoubleValues(rawValues)) {
+ buildStats(metricKey, rawValues, aggregateMetrics);
+ }
+ }
+ Map<String, String> compatibleTestMetrics = TfMetricProtoUtil
+ .compatibleConvert(aggregateMetrics);
+ aggregatedStoredMetrics.put(testName, compatibleTestMetrics);
+ }
+ return aggregatedStoredMetrics;
+ }
+
+ /** Set percentiles */
+ public void setPercentiles(Set<Integer> percentiles) {
+ mActualPercentiles = percentiles;
+ }
+
+ /** Set iteration separator */
+ public void setIterationSeparator(String separator) {
+ mTestIterationSeparator = separator;
+ }
+
+ @VisibleForTesting
+ public Map<String, ArrayListMultimap<String, Metric>> getStoredTestMetric() {
+ return mStoredTestMetrics;
+ }
+
+ /**
+ * Return true is all the values can be parsed to double value.
+ * Otherwise return false.
+ */
+ public static boolean isAllDoubleValues(List<String> rawValues) {
+ return rawValues
+ .stream()
+ .allMatch(
+ val -> {
+ try {
+ Double.parseDouble(val);
+ return true;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * Compute the stats from the give list of values.
+ */
+ public static Map<String, Double> getStats(Collection<Double> values,
+ Set<Integer> percentiles) {
+ Map<String, Double> stats = new LinkedHashMap<>();
+ double sum = values.stream().mapToDouble(Double::doubleValue).sum();
+ double count = values.size();
+ // The orElse situation should never happen.
+ double mean = values.stream()
+ .mapToDouble(Double::doubleValue)
+ .average()
+ .orElseThrow(IllegalStateException::new);
+ double variance = values.stream().reduce(0.0, (a, b) -> a + Math.pow(b - mean, 2) / count);
+ // Calculate percentiles. 50 th percentile will be used as medain.
+ Set<Integer> updatedPercentile = new HashSet<>(percentiles);
+ updatedPercentile.add(50);
+ Map<Integer, Double> percentileStat = Quantiles.percentiles().indexes(updatedPercentile)
+ .compute(values);
+ double median = percentileStat.get(50);
+
+ stats.put(STATS_KEY_MIN, Collections.min(values));
+ stats.put(STATS_KEY_MAX, Collections.max(values));
+ stats.put(STATS_KEY_MEAN, mean);
+ stats.put(STATS_KEY_VAR, variance);
+ stats.put(STATS_KEY_STDEV, Math.sqrt(variance));
+ stats.put(STATS_KEY_MEDIAN, median);
+ stats.put(STATS_KEY_TOTAL, sum);
+ stats.put(STATS_KEY_COUNT, count);
+ percentileStat
+ .entrySet()
+ .stream()
+ .forEach(
+ e -> {
+ // If the percentile is 50, only include it if the user asks for it
+ // explicitly.
+ if (e.getKey() != 50 || percentiles.contains(50)) {
+ stats.put(
+ STATS_KEY_PERCENTILE_PREFIX + e.getKey().toString(),
+ e.getValue());
+ }
+ });
+ return stats;
+ }
+
+ /**
+ * Build stats for the given set of values and build the metrics using the metric key
+ * and stats name and update the results in aggregated metrics.
+ */
+ private void buildStats(String metricKey, List<String> values,
+ Map<String, Metric> aggregateMetrics) {
+ List<Double> doubleValues = values.stream().map(Double::parseDouble)
+ .collect(Collectors.toList());
+ Map<String, Double> stats = getStats(doubleValues, mActualPercentiles);
+ for (String statKey : stats.keySet()) {
+ Metric.Builder metricBuilder = Metric.newBuilder();
+ metricBuilder
+ .getMeasurementsBuilder()
+ .setSingleString(String.format("%2.2f", stats.get(statKey)));
+ aggregateMetrics.put(
+ String.join(STATS_KEY_SEPARATOR, metricKey, statKey),
+ metricBuilder.build());
+ }
+ }
+
+ /**
+ * Get only raw values for processing.
+ */
+ private HashMap<String, Metric> getRawMetricsOnly(Map<String, Metric> metrics) {
+ HashMap<String, Metric> rawMetrics = new HashMap<>();
+ for (Entry<String, Metric> entry : metrics.entrySet()) {
+ if (DataType.RAW.equals(entry.getValue().getType())) {
+ rawMetrics.put(entry.getKey(), entry.getValue());
+ }
+ }
+ return rawMetrics;
+ }
+} \ No newline at end of file
diff --git a/tools/catbox-tradefed/Android.bp b/tools/catbox-tradefed/Android.bp
index f98912b..5d44324 100644
--- a/tools/catbox-tradefed/Android.bp
+++ b/tools/catbox-tradefed/Android.bp
@@ -24,5 +24,5 @@ tradefed_binary_host {
full_name: "Complete Automotive Test in a Box",
version: "1.0",
static_libs: ["cts-tradefed-harness"],
- required: ["compatibility-host-util"],
+ required: ["compatibility-host-util", "catbox-report-lib"],
}
diff --git a/tools/catbox-tradefed/etc/catbox-tradefed b/tools/catbox-tradefed/etc/catbox-tradefed
index abc5fbd..75d6a7e 100644
--- a/tools/catbox-tradefed/etc/catbox-tradefed
+++ b/tools/catbox-tradefed/etc/catbox-tradefed
@@ -73,9 +73,11 @@ fi;
JAR_DIR=${CATBOX_ROOT}/android-catbox/tools
JARS="tradefed
+ loganalysis
compatibility-host-util
catbox-tradefed
- catbox-tradefed-tests"
+ catbox-tradefed-tests
+ catbox-report-lib"
for JAR in $JARS; do
checkFile ${JAR_DIR}/${JAR}.jar
diff --git a/tools/catbox-tradefed/res/config/catbox-common.xml b/tools/catbox-tradefed/res/config/catbox-common.xml
index 462f4ef..51a9cee 100644
--- a/tools/catbox-tradefed/res/config/catbox-common.xml
+++ b/tools/catbox-tradefed/res/config/catbox-common.xml
@@ -19,6 +19,16 @@
<!-- Test Tag -->
<option name="test-tag" value="catbox" />
+ <!-- Target Preparer To Collect Device Info -->
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.DeviceInfoCollector">
+ <option name="apk" value="CtsDeviceInfo.apk"/>
+ <option name="package" value="com.android.compatibility.common.deviceinfo"/>
+ <option name="src-dir" value="/sdcard/device-info-files/"/>
+ <option name="dest-dir" value="device-info-files/"/>
+ <option name="temp-dir" value="temp-device-info-files/"/>
+ <option name="throw-error" value="false"/>
+ </target_preparer>
+
<!-- Basic Reporters -->
<include name="basic-reporters" />
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-app-info-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-app-info-setting.xml
new file mode 100644
index 0000000..cf2a2de
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-app-info-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - App Info Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-app-info-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.AppInfoSettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-appgrid.xml b/tools/catbox-tradefed/res/config/catbox-functional-appgrid.xml
new file mode 100644
index 0000000..e6d9368
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-appgrid.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - App Grid Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-appgrid"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveAppGridTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-audio.xml b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-audio.xml
new file mode 100644
index 0000000..cd2d0d1
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-audio.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Bluetooth Audio Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-bluetooth-audio"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMediaCenterTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-date-time-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-date-time-setting.xml
new file mode 100644
index 0000000..f499265
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-date-time-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Date and Time Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-date-time-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.DateTimeSettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-home.xml b/tools/catbox-tradefed/res/config/catbox-functional-home.xml
new file mode 100644
index 0000000..6bc3677
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-home.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Home Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-home"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveHomeTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-lock-screen.xml b/tools/catbox-tradefed/res/config/catbox-functional-lock-screen.xml
new file mode 100644
index 0000000..221310e
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-lock-screen.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Lock Screen Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-lock-screen"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveLockScreenTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-navigation-bar.xml b/tools/catbox-tradefed/res/config/catbox-functional-navigation-bar.xml
new file mode 100644
index 0000000..337867f
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-navigation-bar.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Navigation Bar Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-navigation-bar"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveNavigationBarTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-network-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-network-setting.xml
new file mode 100644
index 0000000..f04045c
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-network-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Network Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-network-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.WifiSettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-security-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-security-setting.xml
new file mode 100644
index 0000000..3c76795
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-security-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Security Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-security-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.SecuritySettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-setting.xml
index a06ea67..10f6b24 100644
--- a/tools/catbox-tradefed/res/config/catbox-functional-setting.xml
+++ b/tools/catbox-tradefed/res/config/catbox-functional-setting.xml
@@ -29,5 +29,6 @@
<option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
<!-- Tests -->
- <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests" />
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.SettingTest" />
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.SettingSearchTest" />
</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-sound-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-sound-setting.xml
new file mode 100644
index 0000000..14b83c8
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-sound-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Sound Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-sound-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.SoundSettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-system-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-system-setting.xml
new file mode 100644
index 0000000..f032f3c
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-system-setting.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - System Setting Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-system-setting"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsTests android.platform.tests.SystemSettingTest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-ux-restriction.xml b/tools/catbox-tradefed/res/config/catbox-functional-ux-restriction.xml
new file mode 100644
index 0000000..5bc518b
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-ux-restriction.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Complete Automotive Tests - Ux Restriction Functional Tests.">
+ <!-- Common Base -->
+ <include name="catbox-common"/>
+
+ <!-- Device Preparers -->
+ <include name="catbox-preparer"/>
+
+ <!-- Plan -->
+ <option name="plan" value="catbox-functional-ux-restriction"/>
+
+ <!-- Test Args -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.tests" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+
+ <!-- Tests -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveUxRestrictionTests" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-app-start-up-base.xml b/tools/catbox-tradefed/res/config/catbox-performance-app-start-up-base.xml
index ab4ad3b..890e591 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-app-start-up-base.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-app-start-up-base.xml
@@ -14,9 +14,6 @@
limitations under the License.
-->
<configuration description="Automotive App Start-up Performance Test Base.">
- <!-- Test Tag Suffix -->
- <option name="test-tag-suffix" value="appstartup" />
-
<!-- Performance Base -->
<include name="catbox-performance-base" />
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-base.xml b/tools/catbox-tradefed/res/config/catbox-performance-base.xml
index 0e85603..17bd214 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-base.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-base.xml
@@ -17,17 +17,27 @@
<!-- Common Target Preparers -->
<include name="catbox-preparer" />
+ <!-- Result Reporter -->
+ <result_reporter class="com.android.catbox.result.JsonResultReporter">
+ <option name="dest-dir" value="report-log-files/"/>
+ <option name="test-iteration-separator" value="$"/>
+ <option name="aggregate-similar-tests" value="true"/>
+ </result_reporter>
+
<!-- Common Config -->
<include name="catbox-common" />
+ <!-- Test Tag Suffix -->
+ <option name="test-tag-suffix" value="performance" />
+
<!-- Performance Specific Target Preparers -->
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer" />
<target_preparer class="com.android.tradefed.targetprep.PerfettoPreparer" />
<target_preparer class="com.android.tradefed.targetprep.TimeWaster" />
-
- <!-- Metrics Result Reporter -->
- <result_reporter class="com.android.tradefed.result.MetricsXMLResultReporter">
- <option name="metrics-folder" value="metrics"/>
- </result_reporter>
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.ReportLogCollector">
+ <option name="src-dir" value="/sdcard/report-log-files/"/>
+ <option name="dest-dir" value="report-log-files/"/>
+ <option name="temp-dir" value="temp-report-logs/"/>
+ </target_preparer>
</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-dialer.xml b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-dialer.xml
new file mode 100644
index 0000000..b1bf271
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-dialer.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Cold App Start-up Performance Test For Dialer/Phone.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-cold-app-start-up-dialer" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-app-start-up-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=4.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Cold App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:press-home:=false" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:kill-app:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:drop-cache:=true" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.dial" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveDialScenarioTests android.platform.test.scenario.dial.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.dial.OpenAppMicrobenchmark#testOpen" value="dialer_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="cold_startup_com.android.car.dialer-median" value="cold_start_up" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-mediacenter.xml b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-mediacenter.xml
new file mode 100644
index 0000000..50d39fa
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-mediacenter.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Cold App Start-up Performance Test For Mediacenter.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-cold-app-start-up-mediacenter" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-app-start-up-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=4.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Cold App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:press-home:=false" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:kill-app:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:drop-cache:=true" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.mediacenter" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMediaCenterScenarioTests android.platform.test.scenario.mediacenter.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.mediacenter.OpenAppMicrobenchmark#testOpen" value="mediacenter_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="cold_startup_com.android.car.media-median" value="cold_start_up" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-settings.xml b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-settings.xml
index d3681a1..21cb686 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-settings.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-cold-app-start-up-settings.xml
@@ -30,6 +30,8 @@
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iterations:=20" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iteration-separator:=$" />
<!-- Cold App Start Up Options -->
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:press-home:=false" />
@@ -37,8 +39,14 @@
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:drop-cache:=true" />
<!-- Test Package -->
- <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.scenario.settings" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.settings" />
<!-- Test -->
- <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.scenario.settings.OpenAppMicrobenchmark#testOpen" />
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.test.scenario.settings.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.settings.OpenAppMicrobenchmark#testOpen" value="settings_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="cold_startup_com.android.car.settings-median" value="cold_start_up" />
</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-guest.xml b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-guest.xml
new file mode 100644
index 0000000..9dd7470
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-guest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="CATBox Performance Test to measure latency to switch to a new Guest">
+ <include name="catbox-performance-multiuser-base" />
+
+ <!-- Clear pre-created guests -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop fw.max_users 15" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop android.car.number_pre_created_guests 0" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:stop" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:start" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:delay-after-commands:120000" />
+
+ <!--Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMultiuserScenarioTests android.platform.scenario.multiuser.SwitchToNewGuestBenchmark" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:include_creation_time:=true" />
+
+ <!-- Test Metrics Report -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.scenario.multiuser.SwitchToNewGuestBenchmark#testSwitch" value="switch_to_new_guest" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="duration_ms_android.platform.scenario.multiuser.SwitchToNewGuestBenchmark#testSwitch-median" value="duration_ms" />
+
+ <option name="plan" value="catbox-performance-create-and-switch-to-new-guest" />
+</configuration>
+
+
+
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-user.xml b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-user.xml
new file mode 100644
index 0000000..97454a0
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-new-user.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="CATBox Performance Test to measure latency to switch to a new Non-Admin user">
+ <include name="catbox-performance-multiuser-base" />
+
+ <!-- Clear pre-created users -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop fw.max_users 15" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop android.car.number_pre_created_users 0" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:stop" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:start" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:delay-after-commands:120000" />
+
+ <!--Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMultiuserScenarioTests android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:include_creation_time:=true" />
+
+ <!-- Test Metrics Report -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark#testSwitch" value="switch_to_new_user" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="duration_ms_android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark#testSwitch-median" value="duration_ms" />
+
+ <option name="plan" value="catbox-performance-create-and-switch-to-new-user" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-guest.xml b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-guest.xml
new file mode 100644
index 0000000..bfc140a
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-guest.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="CATBox Performance Test to measure latency to switch to a Pre-created Guest">
+ <include name="catbox-performance-multiuser-base" />
+
+ <!-- Set pre-created guests -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop fw.max_users 15" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop android.car.number_pre_created_guests 5" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:stop" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:start" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:delay-after-commands:120000" />
+
+ <!--Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMultiuserScenarioTests android.platform.scenario.multiuser.SwitchToNewGuestBenchmark" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:include_creation_time:=true" />
+
+ <!-- Test Metrics Report -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.scenario.multiuser.SwitchToNewGuestBenchmark#testSwitch" value="switch_to_pre_created_guest" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="duration_ms_android.platform.scenario.multiuser.SwitchToNewGuestBenchmark#testSwitch-median" value="duration_ms" />
+
+ <option name="plan" value="catbox-performance-create-and-switch-to-precreated-guest" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-user.xml b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-user.xml
new file mode 100644
index 0000000..c0acabb
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-create-and-switch-to-precreated-user.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="CATBox Performance Test to measure latency to switch to a Pre-created User">
+ <include name="catbox-performance-multiuser-base" />
+
+ <!-- Clear pre-created guests -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop fw.max_users 15" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:setprop android.car.number_pre_created_users 5" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:stop" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:run-command:start" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.RunCommandTargetPreparer:delay-after-commands:120000" />
+
+ <!--Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMultiuserScenarioTests android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:include_creation_time:=true" />
+
+ <!-- Test Metrics Report -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark#testSwitch" value="switch_to_pre_created_user" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="duration_ms_android.platform.scenario.multiuser.SwitchToNewSecondaryUserBenchmark#testSwitch-median" value="duration_ms" />
+
+ <option name="plan" value="catbox-performance-create-and-switch-to-precreated-user" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-dialer.xml b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-dialer.xml
new file mode 100644
index 0000000..32f8c08
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-dialer.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Hot App Start-up Performance Test For Dialer/Phone.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-hot-app-start-up-dialer" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-app-start-up-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=4.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Hot App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:press-home:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:kill-app:=false" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:drop-cache:=false" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.dial" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveDialScenarioTests android.platform.test.scenario.dial.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.dial.OpenAppMicrobenchmark#testOpen" value="dialer_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="hot_startup_com.android.car.dialer-median" value="hot_start_up" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-mediacenter.xml b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-mediacenter.xml
new file mode 100644
index 0000000..e7e23a5
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-mediacenter.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Hot App Start-up Performance Test For Mediacenter.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-hot-app-start-up-mediacenter" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-app-start-up-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=4.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Hot App Start Up Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:press-home:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:kill-app:=false" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMediaCenterScenarioTests:instrumentation-arg:drop-cache:=false" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.mediacenter" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMediaCenterScenarioTests android.platform.test.scenario.mediacenter.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.mediacenter.OpenAppMicrobenchmark#testOpen" value="mediacenter_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="hot_startup_com.android.car.media-median" value="hot_start_up" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-settings.xml b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-settings.xml
index 5791793..4294da8 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-settings.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-hot-app-start-up-settings.xml
@@ -30,6 +30,8 @@
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.AppStartupListener" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iterations:=20" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iteration-separator:=$" />
<!-- Hot App Start Up Options -->
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:press-home:=true" />
@@ -37,8 +39,14 @@
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:drop-cache:=false" />
<!-- Test Package -->
- <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.scenario.settings" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.settings" />
<!-- Test -->
- <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.scenario.settings.OpenAppMicrobenchmark#testOpen" />
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.test.scenario.settings.OpenAppMicrobenchmark#testOpen" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.settings.OpenAppMicrobenchmark#testOpen" value="settings_app_start_up" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="hot_startup_com.android.car.settings-median" value="hot_start_up" />
</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-jank-appgrid.xml b/tools/catbox-tradefed/res/config/catbox-performance-jank-appgrid.xml
new file mode 100644
index 0000000..0c14d83
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-jank-appgrid.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Jank Performance Test For Settings.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-jank-settings" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-jank-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=2.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- Jank Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.JankListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.appgrid" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveAppGridScenarioTests android.platform.test.scenario.appgrid.ScrollMicrobenchmark#testScrollDownAndUp" />
+
+ <!-- Jank Package -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveAppGridScenarioTests:instrumentation-arg:jank-package-names:=com.android.car.carlauncher" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.appgrid.ScrollMicrobenchmark#testScrollDownAndUp" value="appgrid_scroll_jank" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="gfxinfo_com.android.car.carlauncher_janky_frames_percent-mean" value="jank_frames_percent" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-jank-base.xml b/tools/catbox-tradefed/res/config/catbox-performance-jank-base.xml
index 2b72d86..231f2db 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-jank-base.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-jank-base.xml
@@ -14,9 +14,6 @@
limitations under the License.
-->
<configuration description="Automotive Jank Performance Test Base.">
- <!-- Test Tag Suffix -->
- <option name="test-tag-suffix" value="jank" />
-
<!-- Performance Base -->
<include name="catbox-performance-base" />
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-jank-contact-list.xml b/tools/catbox-tradefed/res/config/catbox-performance-jank-contact-list.xml
new file mode 100644
index 0000000..76d0469
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-jank-contact-list.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Jank Performance Test For Contacts.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-jank-contact-list" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-jank-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=2.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- Jank Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.JankListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.dial" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveDialScenarioTests android.platform.test.scenario.dial.ScrollContactListMicrobenchmark#testScrollDownAndUp" />
+
+ <!-- Jank Package -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveDialScenarioTests:instrumentation-arg:jank-package-names:=com.android.car.dialer" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.dial.ScrollContactListMicrobenchmark#testScrollDownAndUp" value="contacts_scroll_jank" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="gfxinfo_com.android.car.dialer_janky_frames_percent-mean" value="jank_frames_percent" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-jank-notifications.xml b/tools/catbox-tradefed/res/config/catbox-performance-jank-notifications.xml
new file mode 100644
index 0000000..34d1883
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-jank-notifications.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="CATBox Jank Performance Test For Notifications.">
+ <!-- Plan -->
+ <option name="plan" value="catbox-performance-jank-notifications" />
+
+ <!-- Base File -->
+ <include name="catbox-performance-jank-base" />
+
+ <!-- Proc Load Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:procload-collector:per_run:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-interval:=20000" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-threshold:=2.0" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:procload-collector:proc-loadavg-timeout:=900000" />
+
+ <!-- Jank Options -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.JankListener" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:iterations:=20" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Test Package -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.notification" />
+
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveNotificationScenarioTests android.platform.test.scenario.notification.ScrollMicrobenchmark#testScrollUpAndDown" />
+
+ <!-- Jank Package -->
+ <option name="compatibility:module-arg" value="AndroidAutomotiveNotificationScenarioTests:instrumentation-arg:jank-package-names:=com.android.systemui" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.notification.ScrollMicrobenchmark#testScrollUpAndDown" value="notifications_scroll_jank" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="gfxinfo_com.android.systemui_janky_frames_percent-mean" value="jank_frames_percent" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-jank-settings.xml b/tools/catbox-tradefed/res/config/catbox-performance-jank-settings.xml
index 3f8a305..d7f384f 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-jank-settings.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-jank-settings.xml
@@ -30,13 +30,21 @@
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:listener:=android.device.collectors.ProcLoadListener,android.device.collectors.JankListener" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iterations:=20" />
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:favor-shell-commands:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:iteration-separator:=$" />
<!-- Test Package -->
- <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.scenario.settings" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.test.scenario.settings" />
<!-- Test -->
- <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.scenario.settings.ScrollInAppMicrobenchmark#testScrollDownAndUp" />
+ <option name="compatibility:include-filter" value="AndroidAutomotiveSettingsScenarioTests android.platform.test.scenario.settings.ScrollInAppMicrobenchmark#testScrollDownAndUp" />
<!-- Jank Package -->
<option name="compatibility:module-arg" value="AndroidAutomotiveSettingsScenarioTests:instrumentation-arg:jank-package-names:=com.android.car.settings" />
+
+ <!-- Test Metrics Report Options -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.test.scenario.settings.ScrollInAppMicrobenchmark#testScrollDownAndUp" value="settings_scroll_jank" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="gfxinfo_com.android.car.settings_janky_frames_percent-mean" value="jank_frames_percent" />
</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-multiuser-base.xml b/tools/catbox-tradefed/res/config/catbox-performance-multiuser-base.xml
new file mode 100644
index 0000000..e9fea7b
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-multiuser-base.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License
+-->
+<configuration description="Base config for Multi-User latency metrics">
+ <include name="catbox-performance-base" />
+
+ <!-- TradeFed test harness -->
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:runner:androidx.test.runner.AndroidJUnitRunner" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:package:android.platform.scenario.multiuser" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
+ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:shell-timeout:1000000" />
+
+ <!-- Switch to User 0 and wait for a some time (milliseconds) until system idle -->
+ <target_preparer class="com.android.tradefed.targetprep.SwitchUserTargetPreparer" >
+ <option name="user-type" value="SYSTEM" />
+ </target_preparer>
+
+ <option name="compatibility:test-arg" value="com.android.tradefed.targetprep.TimeWaster:delay:20000" />
+
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:iterations:=5" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:rename-iterations:=true" />
+ <option name="compatibility:module-arg" value="AndroidAutomotiveMultiuserScenarioTests:instrumentation-arg:iteration-separator:=$" />
+
+ <!-- Default metrics post processor -->
+ <include name="catbox-performance-postprocessors" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-postprocessors.xml b/tools/catbox-tradefed/res/config/catbox-performance-postprocessors.xml
index 45edd14..7b1773e 100644
--- a/tools/catbox-tradefed/res/config/catbox-performance-postprocessors.xml
+++ b/tools/catbox-tradefed/res/config/catbox-performance-postprocessors.xml
@@ -14,6 +14,5 @@
limitations under the License.
-->
<configuration description="Post Processors to Aggregate Performance Metrics.">
- <!-- Metrics Post Processor -->
- <metric_post_processor class="com.android.tradefed.postprocessor.AggregatePostProcessor" />
+ <!-- No Post Processor -->
</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-performance-switch-to-existing-user.xml b/tools/catbox-tradefed/res/config/catbox-performance-switch-to-existing-user.xml
new file mode 100644
index 0000000..514cf42
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-performance-switch-to-existing-user.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="CATBox Performance Test to measure latency to switch to a Existing User">
+ <include name="catbox-performance-multiuser-base" />
+ <!-- Test -->
+ <option name="compatibility:include-filter" value="AndroidAutomotiveMultiuserScenarioTests android.platform.scenario.multiuser.SwitchToExistingSecondaryUserBenchmark" />
+
+ <!-- Test Metrics Report -->
+ <option name="report-log-name" value="CatboxPerformanceTests" />
+ <option name="report-test-name-mapping" key="android.platform.scenario.multiuser.SwitchToExistingSecondaryUserBenchmark#testSwitch" value="switch_to_existing_user" />
+ <option name="report-all-metrics" value="false" />
+ <option name="report-metric-key-mapping" key="duration_ms_android.platform.scenario.multiuser.SwitchToExistingSecondaryUserBenchmark#testSwitch-median" value="duration_ms" />
+
+ <option name="plan" value="catbox-performance-switch-to-existing-user" />
+</configuration> \ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-preparer.xml b/tools/catbox-tradefed/res/config/catbox-preparer.xml
index 0ca2571..58ad6bf 100644
--- a/tools/catbox-tradefed/res/config/catbox-preparer.xml
+++ b/tools/catbox-tradefed/res/config/catbox-preparer.xml
@@ -14,6 +14,9 @@
limitations under the License.
-->
<configuration description="CATBOX Target Preparer Configuration">
+ <!-- Target Preparers - Disable SELinux before Test Execution -->
+ <target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer" />
+
<!-- Target Preparers - Clean the Device after Test Execution -->
<target_preparer class="com.android.tradefed.targetprep.DeviceCleaner">
<option name="disable" value="true" />
@@ -27,6 +30,7 @@
<!-- Target Preparers - Setup the Device -->
<target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
+ <option name="disable" value="true" />
<option name="screen-always-on" value="on" />
<option name="screen-adaptive-brightness" value="off" />
<option name="screen-saver" value="off" />