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

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

Revert "Read test cacert and keys from files"

This reverts commit af130a4c.

When we build resolv_{unit,integration,stres,gold}_test, testing
pem files are copied and pushed to corresponding output directory.

The following build command moves all of the pem files to out/dist
and thinks that the files are duplicated.

m TARGET_BUILD_APPS="resolv_unit_test resolv_integration_test" dist
(This is a simplified command. The actual command which caused
the issue is in b/193063575)

We will use pipe as a workaround to read the testing certificates.

Bug: 193063575
Test: m TARGET_BUILD_APPS="com.google.android.resolv resolv_unit_test
      resolv_integration_test resolv_gold_test resolv_stress_test" dist
Change-Id: I0553aa4874603089630e771298b16c96946a3c2a
parent 0b61ab57
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -145,9 +145,6 @@ cc_defaults {
            suffix: "64",
        },
    },
    data: [
        ":resolv_test_keys",
    ],
}

cc_library {
+0 −12
Original line number Diff line number Diff line
@@ -27,18 +27,6 @@
       <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
       <option name="append-bitness" value="true" />
   </target_preparer>

   <!-- For test files which are not renamed with bitness appended -->
   <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
       <option name="cleanup" value="true" />
       <option name="push"
            value="server_certificate.pem->/data/local/tmp/test_keys/server_certificate.pem" />
       <option name="push" value="server_key.pem->/data/local/tmp/test_keys/server_key.pem" />
       <option name="push"
            value="ca_certificate.pem->/data/local/tmp/test_keys/ca_certificate.pem" />
       <option name="append-bitness" value="false" />
   </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}" />
+1 −7
Original line number Diff line number Diff line
@@ -89,10 +89,7 @@ cc_test {
    // TODO: Remove the xml after MTS fixing the problem.
    test_config: "resolv_gold_test_config.xml",
    defaults: ["netd_defaults", "resolv_test_defaults"],
    data: [
        ":resolv_gold_test_pbtxt2pb",
        ":resolv_test_keys",
    ],
    data: [":resolv_gold_test_pbtxt2pb"],
    srcs: [
        "resolv_gold_test.cpp",
    ],
@@ -191,9 +188,6 @@ cc_test {
        "libipchecksum",
        "resolv_unsolicited_listener",
    ],
    data: [
        ":resolv_test_keys",
    ],
    // This test talks to the DnsResolver module over a binary protocol on a socket, so keep it as
    // multilib setting is worth because we might be able to get some coverage for the case where
    // 32bit apps talk to 64bit resolvers.
+0 −6
Original line number Diff line number Diff line
@@ -33,12 +33,6 @@ cc_test_library {
        "dns_responder.cpp",
        "dns_responder_client_ndk.cpp",
        "dns_tls_frontend.cpp",
        "dns_tls_certificate.cpp",
    ],
    export_include_dirs: ["."],
}

filegroup {
    name: "resolv_test_keys",
    srcs: ["test_keys/*.pem"],
}
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ bool DnsResponderClient::SetResolversWithTls(const std::vector<std::string>& ser
                                             const std::vector<std::string>& tlsServers,
                                             const std::string& name) {
    const auto& resolverParams = makeResolverParamsParcel(TEST_NETID, params, servers, domains,
                                                          name, tlsServers, sCaCert);
                                                          name, tlsServers, kCaCert);
    const auto rv = mDnsResolvSrv->setResolverConfiguration(resolverParams);
    if (!rv.isOk()) LOG(ERROR) << "SetResolversWithTls() -> " << rv.getMessage();
    return rv.isOk();
@@ -148,7 +148,7 @@ bool DnsResponderClient::SetResolversFromParcel(const ResolverParamsParcel& reso
ResolverParamsParcel DnsResponderClient::GetDefaultResolverParamsParcel() {
    return makeResolverParamsParcel(TEST_NETID, kDefaultParams, kDefaultServers,
                                    kDefaultSearchDomains, {} /* tlsHostname */, kDefaultServers,
                                    sCaCert);
                                    kCaCert);
}

void DnsResponderClient::SetupDNSServers(unsigned numServers, const std::vector<Mapping>& mappings,
Loading