diff options
| -rw-r--r-- | tests/common/AndroidTest_Coverage.xml | 2 | ||||
| -rw-r--r-- | tests/native/Android.bp | 3 | ||||
| -rw-r--r-- | tests/native/AndroidTestTemplate.xml | 30 |
3 files changed, 33 insertions, 2 deletions
diff --git a/tests/common/AndroidTest_Coverage.xml b/tests/common/AndroidTest_Coverage.xml index 7c8e710053..d4898b2293 100644 --- a/tests/common/AndroidTest_Coverage.xml +++ b/tests/common/AndroidTest_Coverage.xml @@ -18,6 +18,8 @@ </target_preparer> <option name="test-tag" value="ConnectivityCoverageTests" /> + <!-- Tethering/Connectivity is a SDK 30+ module --> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController" /> <option name="config-descriptor:metadata" key="mainline-param" value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex" /> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="com.android.connectivity.tests.coverage" /> diff --git a/tests/native/Android.bp b/tests/native/Android.bp index cd438f66c2..fc87815bb3 100644 --- a/tests/native/Android.bp +++ b/tests/native/Android.bp @@ -5,8 +5,8 @@ cc_test { "mts-tethering", "vts", ], + test_config_template: "AndroidTestTemplate.xml", min_sdk_version: "31", - require_root: true, tidy: false, srcs: [ "connectivity_native_test.cpp", @@ -26,5 +26,4 @@ cc_test { "libutils", ], compile_multilib: "first", - defaults: ["connectivity-mainline-presubmit-cc-defaults"], } diff --git a/tests/native/AndroidTestTemplate.xml b/tests/native/AndroidTestTemplate.xml new file mode 100644 index 0000000000..44e35a93da --- /dev/null +++ b/tests/native/AndroidTestTemplate.xml @@ -0,0 +1,30 @@ +<!-- Copyright (C) 2022 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="Configuration for connectivity {MODULE} tests"> + <option name="test-suite-tag" value="mts" /> + <option name="config-descriptor:metadata" key="mainline-param" value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex" /> + <!-- The tested code is only part of a SDK 30+ module (Tethering) --> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController" /> + + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> + <option name="cleanup" value="true" /> + <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" /> + </target_preparer> + <test class="com.android.tradefed.testtype.GTest" > + <option name="native-test-device-path" value="/data/local/tmp" /> + <option name="module-name" value="{MODULE}" /> + </test> +</configuration> |
