Add traffic_controller, networkstats, netd_updatable tests to MTS.
In order to get counted by mts code coverage, these native tests need to be run as part of mts. Bug: 233904825 Test: m mts && mts-tradefed run mts-tethering-coverage Change-Id: I79313197b146c7043ffb5e164faa46c2e16dd1d2
This commit is contained in:
parent
bd77794547
commit
b9266bf507
5 changed files with 63 additions and 3 deletions
|
|
@ -55,7 +55,8 @@ cc_library {
|
|||
cc_test {
|
||||
name: "netd_updatable_unit_test",
|
||||
defaults: ["netd_defaults"],
|
||||
test_suites: ["general-tests"],
|
||||
test_suites: ["general-tests", "mts-tethering"],
|
||||
test_config_template: ":net_native_test_config_template",
|
||||
require_root: true, // required by setrlimitForTest()
|
||||
header_libs: [
|
||||
"bpf_connectivity_headers",
|
||||
|
|
@ -72,6 +73,7 @@ cc_test {
|
|||
"liblog",
|
||||
"libnetdutils",
|
||||
],
|
||||
compile_multilib: "both",
|
||||
multilib: {
|
||||
lib32: {
|
||||
suffix: "32",
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ cc_library {
|
|||
|
||||
cc_test {
|
||||
name: "libnetworkstats_test",
|
||||
test_suites: ["general-tests"],
|
||||
test_suites: ["general-tests", "mts-tethering"],
|
||||
test_config_template: ":net_native_test_config_template",
|
||||
require_root: true, // required by setrlimitForTest()
|
||||
header_libs: ["bpf_connectivity_headers"],
|
||||
srcs: [
|
||||
|
|
@ -68,4 +69,13 @@ cc_test {
|
|||
"libbase",
|
||||
"liblog",
|
||||
],
|
||||
compile_multilib: "both",
|
||||
multilib: {
|
||||
lib32: {
|
||||
suffix: "32",
|
||||
},
|
||||
lib64: {
|
||||
suffix: "64",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ cc_library {
|
|||
|
||||
cc_test {
|
||||
name: "traffic_controller_unit_test",
|
||||
test_suites: ["general-tests"],
|
||||
test_suites: ["general-tests", "mts-tethering"],
|
||||
test_config_template: ":net_native_test_config_template",
|
||||
require_root: true,
|
||||
local_include_dirs: ["include"],
|
||||
header_libs: [
|
||||
|
|
@ -71,4 +72,13 @@ cc_test {
|
|||
"libnetd_updatable",
|
||||
"netd_aidl_interface-lateststable-ndk",
|
||||
],
|
||||
compile_multilib: "both",
|
||||
multilib: {
|
||||
lib32: {
|
||||
suffix: "32",
|
||||
},
|
||||
lib64: {
|
||||
suffix: "64",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,3 +31,10 @@ cc_test {
|
|||
],
|
||||
compile_multilib: "first",
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "net_native_test_config_template",
|
||||
srcs: [
|
||||
"NetNativeTestConfigTemplate.xml",
|
||||
],
|
||||
}
|
||||
|
|
|
|||
31
tests/native/NetNativeTestConfigTemplate.xml
Normal file
31
tests/native/NetNativeTestConfigTemplate.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!-- 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 {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" />
|
||||
<!-- Only run tests if the device under test is SDK version 33 (Android 13) or above. -->
|
||||
<object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk33ModuleController" />
|
||||
|
||||
<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}" />
|
||||
<option name="append-bitness" value="true" />
|
||||
</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>
|
||||
Loading…
Reference in a new issue