Seperate common configs into BootTime common file am: d27ef10db5 am: 49fcf51ecf

Original change: https://googleplex-android-review.googlesource.com/c/platform/test/catbox/+/27630573

Change-Id: I2e7ce3d08dd5652539750062528f4157ad22db3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/target_preparers/src/com/android/catbox/targetpreparer/ChromeMdPassengerLoadPreparer.java b/target_preparers/src/com/android/catbox/targetpreparer/ChromeMdPassengerLoadPreparer.java
new file mode 100644
index 0000000..9fc4e88
--- /dev/null
+++ b/target_preparers/src/com/android/catbox/targetpreparer/ChromeMdPassengerLoadPreparer.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2023 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.targetpreparer;
+
+import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.config.Option;
+import com.android.tradefed.config.OptionClass;
+import com.android.tradefed.device.CollectingOutputReceiver;
+import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.device.ITestDevice;
+import com.android.tradefed.invoker.TestInformation;
+import com.android.tradefed.log.LogUtil;
+import com.android.tradefed.result.error.DeviceErrorIdentifier;
+import com.android.tradefed.targetprep.BaseTargetPreparer;
+import com.android.tradefed.targetprep.BuildError;
+import com.android.tradefed.targetprep.TargetSetupError;
+import com.android.tradefed.targetprep.TestAppInstallSetup;
+import com.android.tradefed.util.CommandResult;
+import com.android.tradefed.util.CommandStatus;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@OptionClass(alias = "chrome-md-passenger-load")
+public class ChromeMdPassengerLoadPreparer extends BaseTargetPreparer {
+    private static final String INSTR_SUCCESS = "OK (1 test)";
+
+    @Option(name = "skip-display-id", description = "Display id to skip passenger load for")
+    private List<Integer> mSkipDisplayIds = new ArrayList<>();
+
+    @Option(name = "url", description = "Url to open in Chrome browser", mandatory = true)
+    private String mUrl;
+
+    @Option(name = "package", description = "Chrome package")
+    private String mPackage = "com.android.chrome";
+
+    @Option(name = "activity", description = "Chrome activity")
+    private String mActivity = "com.google.android.apps.chrome.Main";
+
+    @Option(
+            name = "test-app-file-name",
+            description =
+                    "the name of an apk file to be installed in the user profiles.")
+    private List<String> mTestFiles = new ArrayList<>();
+
+    Map<Integer, Integer> mDisplayToCreatedUsers = new HashMap<>();
+    private final ArrayList<TestAppInstallSetup> mInstallPreparers =
+            new ArrayList<TestAppInstallSetup>();
+
+    @Override
+    public void setUp(TestInformation testInfo) throws TargetSetupError, BuildError,
+            DeviceNotAvailableException {
+        ITestDevice device = testInfo.getDevice();
+        Set<Integer> displayIds = device.listDisplayIdsForStartingVisibleBackgroundUsers();
+        for (Integer displayId : displayIds) {
+            if (mSkipDisplayIds.contains(displayId)) {
+                LogUtil.CLog.d("Skipping load on display %d", displayId);
+                continue;
+            }
+            int userId = createUser(device, displayId);
+            mDisplayToCreatedUsers.put(displayId, userId);
+        }
+
+        if (mDisplayToCreatedUsers.size() == 0) {
+            LogUtil.CLog.w("Won't create any passenger load. No display ids matched.");
+            throw new TargetSetupError(
+                    String.format("Available displays on the device %s. Skipped displays %s",
+                            displayIds, mSkipDisplayIds),
+                    device.getDeviceDescriptor());
+        }
+
+        installApks(testInfo);
+
+        for (Integer displayId : mDisplayToCreatedUsers.keySet()) {
+            int userId = mDisplayToCreatedUsers.get(displayId);
+            dismissInitialDialog(device, userId);
+            simulatePassengerLoad(device, userId);
+        }
+    }
+
+    @Override
+    public void tearDown(TestInformation testInfo, Throwable e)
+            throws DeviceNotAvailableException {
+        ITestDevice device = testInfo.getDevice();
+        for (TestAppInstallSetup installPreparer : mInstallPreparers) {
+            installPreparer.tearDown(testInfo, e);
+        }
+        for (int userId : mDisplayToCreatedUsers.values()) {
+            device.removeUser(userId);
+        }
+    }
+
+    private int createUser(ITestDevice device, int displayId)
+            throws TargetSetupError,
+            DeviceNotAvailableException {
+        int userId = device.createUser(String.format("user-display-%d", displayId));
+        LogUtil.CLog.d(
+                String.format("Created user with id %d for display %d", userId, displayId));
+        if (!device.startVisibleBackgroundUser(userId, displayId, true)) {
+            throw new TargetSetupError(
+                    String.format("Device failed to switch to user %d", userId),
+                    device.getDeviceDescriptor());
+        }
+        LogUtil.CLog.d(
+                String.format("Started background user %d for display %d", userId, displayId));
+        return userId;
+    }
+
+    private void installApks(TestInformation testInfo)
+            throws TargetSetupError, BuildError, DeviceNotAvailableException {
+        for (int userId : mDisplayToCreatedUsers.values()) {
+            TestAppInstallSetup installPreparer = new TestAppInstallSetup();
+            LogUtil.CLog.d(
+                    String.format("Installing the following test APKs in user %d: \n%s", userId,
+                            mTestFiles));
+            installPreparer.setUserId(userId);
+            installPreparer.setShouldGrantPermission(true);
+            for (String file : mTestFiles) {
+                installPreparer.addTestFileName(file);
+            }
+            installPreparer.addInstallArg("-r");
+            installPreparer.addInstallArg("-d");
+            installPreparer.setUp(testInfo);
+            mInstallPreparers.add(installPreparer);
+        }
+    }
+
+    private void simulatePassengerLoad(ITestDevice device, int userId)
+            throws TargetSetupError, DeviceNotAvailableException {
+        LogUtil.CLog.d(String.format("Launching Chrome for User %d with url %s", userId, mUrl));
+        String launchChromeActivityWithUrlCommand = String.format(
+                "am start -n %s/%s --user %d -a android.intent.action.VIEW -d %s", mPackage,
+                mActivity, userId, mUrl);
+        CommandResult result = device.executeShellV2Command(launchChromeActivityWithUrlCommand);
+        if (!CommandStatus.SUCCESS.equals(result.getStatus())) {
+            throw new TargetSetupError(
+                    String.format("Chrome activity failed to launch for user %d", userId),
+                    device.getDeviceDescriptor());
+        }
+    }
+
+    private void dismissInitialDialog(ITestDevice device, int userId)
+            throws DeviceNotAvailableException, TargetSetupError {
+        OutputStream output = new ByteArrayOutputStream();
+        String dismissCommand = String.format(
+                "am instrument -w --user %d -e class android.platform.tests"
+                        + ".ChromeDismissDialogsTest android.platform.tests/androidx.test.runner"
+                        + ".AndroidJUnitRunner",
+                userId);
+        device.executeShellV2Command(dismissCommand, output);
+        if (!output.toString().contains(INSTR_SUCCESS)) {
+            throw new TargetSetupError(
+                    String.format("Failed dismissal.\nCommand output: %s", output),
+                    device.getDeviceDescriptor(),
+                    DeviceErrorIdentifier.DEVICE_UNEXPECTED_RESPONSE);
+        }
+    }
+}
diff --git a/tools/catbox-common/res/config/catbox-performance-base.xml b/tools/catbox-common/res/config/catbox-performance-base.xml
index 6109552..1b1bec5 100644
--- a/tools/catbox-common/res/config/catbox-performance-base.xml
+++ b/tools/catbox-common/res/config/catbox-performance-base.xml
@@ -14,29 +14,37 @@
      limitations under the License.
 -->
 <configuration description="Automotive Performance Test Base.">
-  <!-- Common Target Preparers -->
-  <include name="catbox-preparer" />
+    <!-- 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>
+    <!-- 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" />
+    <!-- Common Config -->
+    <include name="catbox-common"/>
 
-  <!-- Test Tag Suffix -->
-  <option name="test-tag-suffix" value="performance" />
+    <!-- Test Tag Suffix -->
+    <option name="test-tag-suffix" value="performance"/>
 
-  <!-- Performance Specific Target Preparers -->
-  <target_preparer class="com.android.tradefed.targetprep.PerfettoPreparer" />
-  <target_preparer class="com.android.tradefed.targetprep.TimeWaster" />
-  <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>
+    <!-- Performance Specific Target Preparers -->
+    <target_preparer class="com.android.tradefed.targetprep.PerfettoPreparer"/>
+    <target_preparer class="com.android.tradefed.targetprep.TimeWaster"/>
+    <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>
+    <target_preparer class="com.android.catbox.targetpreparer.ChromeMdPassengerLoadPreparer">
+        <option name="disable" value="true"/>
+        <option name="url" value="https://youtu.be/dQw4w9WgXcQ"/>
+    </target_preparer>
+
+    <!-- Enable perfetto host side metric collector -->
+    <include name="perfetto-puller"/>
 
 </configuration>
diff --git a/tools/catbox-common/res/config/perfetto-puller.xml b/tools/catbox-common/res/config/perfetto-puller.xml
new file mode 100644
index 0000000..a29cf72
--- /dev/null
+++ b/tools/catbox-common/res/config/perfetto-puller.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2023 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="Pull the files from the device and add it to the test logs.">
+    <!-- Pulls the perfetto files from the device and collects the metrics from the trace files -->
+    <metrics_collector class="com.android.tradefed.device.metric.PerfettoPullerMetricCollector" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-palette.xml b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-palette.xml
new file mode 100644
index 0000000..86413bd
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-palette.xml
@@ -0,0 +1,31 @@
+<!--
+ Copyright (C) 2023 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 - Status Bar Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common" />
+  <!-- Device Preparers -->
+  <include name="catbox-preparer" />
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-bluetooth-palette" />
+  <!-- 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="AndroidAutomotiveStatusBarTests android.platform.tests.BluetoothPaletteTest" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-tests.xml b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-tests.xml
new file mode 100644
index 0000000..7630707
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-bluetooth-tests.xml
@@ -0,0 +1,68 @@
+<!--
+ Copyright (C) 2023 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="Bluetooth Tests Using Mobly">
+  <!-- Plan -->
+  <!-- TODO(@vitalidim) rename test plan since it's not for bt discovery only -->
+  <option name="plan" value="catbox-functional-bluetooth-tests"/>
+
+  <include name="everything" />
+
+  <!-- Template for Result Reporters -->
+  <template-include name="reporters" default="empty" />
+
+  <!-- Test Tag -->
+  <option name="test-tag" value="catbox" />
+
+  <!-- Basic Reporters -->
+  <include name="basic-reporters" />
+
+  <!-- Template for Metadata Reporters -->
+  <template-include name="metadata-reporters" default="empty" />
+
+  <!-- Default ABI -->
+  <option name="compatibility:primary-abi-only" value="true" />
+
+  <device name="auto" >
+    <!-- Build Provider -->
+    <build_provider class="com.android.compatibility.common.tradefed.build.CompatibilityBuildProvider" />
+    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller" >
+      <option name="test-file-name" value="AutomotiveSnippet.apk" />
+    </target_preparer>
+  </device>
+
+  <device name="phone">
+    <!-- Build Provider -->
+    <build_provider class="com.android.compatibility.common.tradefed.build.CompatibilityBuildProvider" />
+    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller" >
+      <option name="test-file-name" value="PhoneSnippet.apk" />
+    </target_preparer>
+  </device>
+
+  <!--
+      CATBox Runs all modules if it is not specified.
+      So, we need to skip these modules in case of Mobly tests
+      which can be done by adding following option.
+   -->
+  <option name="compatibility:reverse-exclude-filters" value="true" />
+
+  <test class="com.android.tradefed.testtype.mobly.MoblyBinaryHostTest">
+    <!-- The mobly-par-file-name should match the module name -->
+    <!-- Timeout limit in milliseconds for all test cases of the python binary -->
+    <option name="mobly-test-timeout" value="180000" />
+    <!-- Testbed config file -->
+    <option name="mobly-config-file-name" value="bt_discovery_config.yaml" />
+  </test>
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-brightness-palette.xml b/tools/catbox-tradefed/res/config/catbox-functional-brightness-palette.xml
new file mode 100644
index 0000000..633828a
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-brightness-palette.xml
@@ -0,0 +1,31 @@
+<!--
+ Copyright (C) 2023 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 - Status Bar Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common" />
+  <!-- Device Preparers -->
+  <include name="catbox-preparer" />
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-brightness-palette" />
+  <!-- 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 android.platform.tests.BrightnessPaletteTest" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-driving-optimized-apps.xml b/tools/catbox-tradefed/res/config/catbox-functional-driving-optimized-apps.xml
index a21e086..01b61d7 100644
--- a/tools/catbox-tradefed/res/config/catbox-functional-driving-optimized-apps.xml
+++ b/tools/catbox-tradefed/res/config/catbox-functional-driving-optimized-apps.xml
@@ -29,5 +29,5 @@
   <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:no-rerun:true" />
 
   <!-- Tests -->
-  <option name="compatibility:include-filter" value="AndroidAutomotiveUxRestrictionTests android.platform.tests.UxRestrictionDOAppsTest" />
+  <option name="compatibility:include-filter" value="AndroidAutomotiveUxRestrictionTests android.platform.tests.DrivingOptimizedAppsTest" />
 </configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-enable-developers-option.xml b/tools/catbox-tradefed/res/config/catbox-functional-enable-developers-option.xml
new file mode 100644
index 0000000..abd22d7
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-enable-developers-option.xml
@@ -0,0 +1,34 @@
+<!--
+ Copyright (C) 2023 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 - Enable Developers Option Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-enable-developers-option"/>
+
+  <!-- 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.EnableDevelopersOption" />
+</configuration>
+
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-network-palette.xml b/tools/catbox-tradefed/res/config/catbox-functional-network-palette.xml
new file mode 100644
index 0000000..dd661a8
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-network-palette.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2023 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 - Status Bar Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-network-palette"/>
+
+  <!-- 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="AndroidAutomotiveStatusBarTests android.platform.tests.NetworkPaletteTest" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-privacy-permission-manager.xml b/tools/catbox-tradefed/res/config/catbox-functional-privacy-permission-manager.xml
new file mode 100644
index 0000000..1406305
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-privacy-permission-manager.xml
@@ -0,0 +1,34 @@
+<!--
+ Copyright (C) 2023 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 - Privacy App Permission Setting Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-privacy-permission-manager"/>
+
+  <!-- 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.PrivacyPermissionManagerTest" />
+</configuration>
+
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-privacy-setting-ui-elements.xml b/tools/catbox-tradefed/res/config/catbox-functional-privacy-setting-ui-elements.xml
new file mode 100644
index 0000000..644aca5
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-privacy-setting-ui-elements.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2023 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 - Privacy Setting Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-privacy-setting-ui-elements"/>
+
+  <!-- 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.PrivacySettingVerifyUIElementsTest" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-profile-icon.xml b/tools/catbox-tradefed/res/config/catbox-functional-profile-icon.xml
new file mode 100644
index 0000000..b7e0c47
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-profile-icon.xml
@@ -0,0 +1,40 @@
+<!--
+ Copyright (C) 2023 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 - profile icon Bar Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common" />
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer" />
+
+  <!-- Enable system user target preparer to run as user 0 -->
+  <option name="run-on-system-user:disable" value="false" />
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-profile-icon" />
+
+  <!-- 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="AndroidAutomotiveProfileIconTests android.platform.tests.ProfileIconTest" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-profiles-icon-list.xml b/tools/catbox-tradefed/res/config/catbox-functional-profiles-icon-list.xml
new file mode 100644
index 0000000..a62ead1
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-profiles-icon-list.xml
@@ -0,0 +1,38 @@
+<!--
+ Copyright (C) 2023 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 - Profiles Icon List Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Enable system user target preparer to run as user 0 -->
+  <option name="run-on-system-user:disable" value="false" />
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-profiles-icon-list"/>
+
+  <!-- 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="AndroidAutomotiveProfileIconListTests android.platform.tests.ProfileIconsListTest" />
+</configuration>
+
+
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-settings-location.xml b/tools/catbox-tradefed/res/config/catbox-functional-settings-location.xml
new file mode 100644
index 0000000..8b5ab15
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-settings-location.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2023 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 - Setting Location Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-settings-location"/>
+
+  <!-- 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="AndroidAutomotiveSettingsLocationTests android.platform.tests.SettingsLocationTest" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-status-bar.xml b/tools/catbox-tradefed/res/config/catbox-functional-status-bar.xml
new file mode 100644
index 0000000..2ab8336
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-status-bar.xml
@@ -0,0 +1,38 @@
+<!--
+ Copyright (C) 2023 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 - status Bar Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common" />
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer" />
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-status-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="AndroidAutomotiveStatusBarTests android.platform.tests.StatusBarTest" />
+</configuration>
\ No newline at end of file
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-storage-setting.xml b/tools/catbox-tradefed/res/config/catbox-functional-storage-setting.xml
new file mode 100644
index 0000000..c21fb4a
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-storage-setting.xml
@@ -0,0 +1,27 @@
+
+<!--
+ Copyright (C) 2023 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 - Storage Setting Functional Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-storage-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.StorageSettingTest" />
+</configuration>
diff --git a/tools/catbox-tradefed/res/config/catbox-functional-systemui.xml b/tools/catbox-tradefed/res/config/catbox-functional-systemui.xml
new file mode 100644
index 0000000..fcaae21
--- /dev/null
+++ b/tools/catbox-tradefed/res/config/catbox-functional-systemui.xml
@@ -0,0 +1,33 @@
+<!--
+ Copyright (C) 2023 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 UI Tests.">
+  <!-- Common Base -->
+  <include name="catbox-common"/>
+
+  <!-- Device Preparers -->
+  <include name="catbox-preparer"/>
+
+  <!-- Plan -->
+  <option name="plan" value="catbox-functional-systemui"/>
+
+  <!-- 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 android.platform.tests.SystemUiTest" />
+</configuration>
\ No newline at end of file