android_packages_modules_Co.../tests/cts/tethering/AndroidTestTemplate.xml
Junyu Lai 90c80840d8 Test Tethering/NetworkStack package existence for SYSTEM and FULL users.
Follow-up from aosp/3405539, it is possible that OEMs do not
install Tethering/NetworkStack for certain user types.
This is undesirable. Therefore, enforce this with CTS test cases.

Flag: TEST_ONLY
Test: m CtsTetheringTest && atest \
      CtsTetheringTest:android.tethering.test.TetheringManagerTest
Fix: 400836850

Change-Id: I176d4930040d288846bde43beda9e30519ecd513
2025-04-16 06:57:18 -07:00

58 lines
3.6 KiB
XML

<?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="Config for {MODULE}">
<option name="test-suite-tag" value="cts" />
<option name="config-descriptor:metadata" key="component" value="networking" />
<option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- The 'run_on_secondary_user' parameter triggers a second test iteration
targeting secondary users. This is only applicable to tests explicitly marked
with @UserTest(UserType.SECONDARY_USER) or @RequireRunOnSecondaryUser.
-->
<option name="config-descriptor:metadata" key="parameter" value="run_on_secondary_user" />
<option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
<option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
<!-- '[not_]secondary_user' is mandatory to declare the tests could [not] be run on
the secondary user. See CtsConfigLoadingTest#testConfigurationLoad.
-->
<option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
<option name="config-descriptor:metadata" key="mainline-param" value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex" />
<option name="not-shardable" value="true" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="{MODULE}.apk" />
</target_preparer>
<target_preparer class="com.android.testutils.ConnectivityTestTargetPreparer">
</target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="android.tethering.cts" />
<option name="device-listeners" value="com.android.testutils.ConnectivityDiagnosticsCollector" />
<!-- Tests with these annotations should only be ran with their corresponding
configurations, e.g. Tests with the RequireRunOnWorkProfile annotation should be
ran with the run_on_work_profile configuration. Exclude these tests from running
with the normal configuration. See go/bedstead-devicestate#androidtestxml
-->
<option name="exclude-annotation" value="com.android.bedstead.multiuser.annotations.RequireRunOnSecondaryUser" />
</test>
<metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
<!-- Pattern matching the fileKey used by ConnectivityDiagnosticsCollector when calling addFileMetric -->
<option name="pull-pattern-keys" value="com.android.testutils.ConnectivityDiagnosticsCollector.*"/>
<option name="collect-on-run-ended-only" value="true" />
</metrics_collector>
<object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
<option name="mainline-module-package-name" value="com.google.android.tethering" />
</object>
</configuration>