Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdc6d3bb authored by Mike Yu's avatar Mike Yu
Browse files

Add a test config template for doh_ffi_test

resolv_test_config_template is used for the tests that require root
access. We can't use it for doh_ffi_test because doh_ffi_test needs
to be run by mts-user that runs tests on user build.
So add a test config template that doesn't contain RootTargetPreparer
for doh_ffi_test.

Bug: 259349997
Test: run mts-dnsresolver -m doh_ffi_test on a user build
Change-Id: I0c4f791ead2fd3ec16b2b94ef5403e1b73254c11
parent 0bfb5a4c
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -150,6 +150,22 @@ cc_defaults {
    },
}

cc_defaults {
    // Similar to resolv_test_mts_coverage_defaults, but it's for the tests that don't need
    // root access.
    name: "resolv_test_mts_coverage_without_root_defaults",
    test_config_template: ":resolv_test_config_without_root_template",
    compile_multilib: "both",
    multilib: {
        lib32: {
            suffix: "32",
        },
        lib64: {
            suffix: "64",
        },
    },
}

cc_library {
    name: "libnetd_resolv",
    version_script: "libnetd_resolv.map.txt",
@@ -307,6 +323,13 @@ filegroup {
    ],
}

filegroup {
    name: "resolv_test_config_without_root_template",
    srcs: [
        "resolv_test_config_without_root_template.xml",
    ],
}

filegroup {
    name: "resolv_unit_test_files",
    srcs: [
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<!-- Workaround for MTS coverage because test infra is running the 64 bit
     test suite on cf_x86_phone (32-bit). See b/147785146 for details.
     We need to push the correct binary against the architecture of
     test device with "append-bitness" option.
-->
<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" />
   <target_preparer class="com.android.testutils.DisableConfigSyncTargetPreparer" />
   <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}" />
       <option name="runtime-hint" value="10m" />
       <!-- test-timeout unit is ms, value = 10 min -->
       <option name="native-test-timeout" value="600000" />
   </test>
</configuration>
+1 −1
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ cc_test {
        "connectivity-mainline-presubmit-cc-defaults",
        "netd_defaults",
        "resolv_test_defaults",
        "resolv_test_mts_coverage_defaults",
        "resolv_test_mts_coverage_without_root_defaults",
    ],
    header_libs: [
        "libnetd_resolv_internal_headers",