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

Commit b65e32a4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6329815 from 83c945db to rvc-release

Change-Id: If9e4144a3c137adcc48fc58cb460f52f26f7d7d2
parents a2a10f4d 83c945db
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -40,6 +40,18 @@ aidl_interface {
    ],
}

cc_defaults {
    name: "resolv_test_defaults",
    // Note that, static link liblog and libbase is a hard requirement for resolv related tests
    // because libbase is not compatible between Q and R for general platform build due
    // to its log revelant functions changing. And most of resolv related tests must be able to run
    // in Q.
    static_libs: [
        "libbase",
        "liblog",
    ],
}

cc_library {
    name: "libnetd_resolv",
    version_script: "libnetd_resolv.map.txt",
@@ -182,7 +194,7 @@ cc_test {
    test_suites: ["device-tests", "mts"],
    require_root: true,
    //TODO:  drop root privileges and make it be an real unit test.
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    srcs: [
        "resolv_cache_unit_test.cpp",
        "resolv_callback_unit_test.cpp",
@@ -194,14 +206,12 @@ cc_test {
    shared_libs: [
        "libcrypto",
        "libbinder_ndk",
        "liblog",
        "libssl",
    ],
    static_libs: [
        "dnsresolver_aidl_interface-unstable-ndk_platform",
        "netd_event_listener_interface-ndk_platform",
        "libcutils",
        "libbase",
        "libgmock",
        "libnetd_resolv",
        "libnetd_test_dnsresponder",
+4 −0
Original line number Diff line number Diff line
@@ -102,6 +102,10 @@ int PrivateDnsConfiguration::set(int32_t netId, uint32_t mark,
        mPrivateDnsTransports.erase(netId);
        resolv_stats_set_servers_for_dot(netId, {});
        mPrivateDnsValidateThreads.erase(netId);
        // TODO: As mPrivateDnsValidateThreads is reset, validation threads which haven't yet
        // finished are considered outdated. Consider signaling the outdated validation threads to
        // stop them from updating the state of PrivateDnsConfiguration (possibly disallow them to
        // report onPrivateDnsValidationEvent).
        return 0;
    }

+47 −22
Original line number Diff line number Diff line
cc_test_library {
    name: "libnetd_test_resolv_utils",
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    srcs: [
        "resolv_test_utils.cpp",
    ],
@@ -8,7 +8,6 @@ cc_test_library {
        "libnetd_resolv_headers",
    ],
    shared_libs: [
        "libbase",
        "libutils",
    ],
    static_libs: [
@@ -17,6 +16,46 @@ cc_test_library {
    ],
}

cc_library_host_static {
    name: "golddata_proto_host",
    proto: {
        export_proto_headers: true,
        type: "full",
    },
    srcs: [
        "golddata.proto",
    ],
}

cc_binary_host {
    name: "resolv_gold_test_pbtxt2pb_host",
    cflags: [
        "-Wall",
        "-Werror",
    ],
    srcs: ["pbtxt2pb_converter_host.cpp"],
    static_libs: [
        "golddata_proto_host",
        "libc++fs",
        "libprotobuf-cpp-full",
    ],
}

genrule {
    name: "resolv_gold_test_pbtxt2pb",
    tools: [
        "resolv_gold_test_pbtxt2pb_host",
        "soong_zip",
    ],
    srcs: ["testdata/*.pbtxt"],
    // convert .pbtxt to .pb files; zip them as a single pb.zip.
    cmd: "mkdir $(genDir)/pb && for fname in $(in); " +
         "do $(location resolv_gold_test_pbtxt2pb_host) --in_file=$$fname " +
         "--out_dir=$(genDir)/pb; done && " +
         "$(location soong_zip) -o $(out) -C $(genDir)/pb -D $(genDir)/pb",
    out: ["testdata/pb.zip"],
}

cc_library_static {
    name: "golddata_proto",
    defaults: ["netd_defaults"],
@@ -37,8 +76,8 @@ cc_test {
    // can not handle the test with testdata correctly.
    // TODO: Remove the xml after MTS fixing the problem.
    test_config: "resolv_gold_test_config.xml",
    defaults: ["netd_defaults"],
    data: ["testdata/pb/*.pb"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    data: [":resolv_gold_test_pbtxt2pb"],
    srcs: [
        "resolv_gold_test.cpp",
    ],
@@ -48,13 +87,11 @@ cc_test {
    shared_libs: [
        "libcrypto",
        "libbinder_ndk",
        "liblog",
        "libssl",
    ],
    static_libs: [
        "dnsresolver_aidl_interface-unstable-ndk_platform",
        "golddata_proto",
        "libbase",
        "libgmock",
        "libnetd_resolv",
        "libnetd_test_dnsresponder_ndk",
@@ -75,7 +112,7 @@ cc_test {
    // This won't work with test_config
    // require_root: true,
    test_config: "resolv_stress_test_config.xml",
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    srcs: [
        "resolv_stress_test.cpp",
    ],
@@ -84,12 +121,10 @@ cc_test {
    ],
    shared_libs: [
        "libbinder_ndk",
        "liblog",
        "libnetd_client",
    ],
    static_libs: [
        "dnsresolver_aidl_interface-ndk_platform",
        "libbase",
        "libgmock",
        "libnetd_test_dnsresponder_ndk",
        "libnetd_test_resolv_utils",
@@ -106,7 +141,7 @@ cc_test {
    test_suites: ["device-tests", "mts"],
    require_root: true,
    test_config: "resolv_integration_test_config.xml",
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    tidy: false, // cuts test build time by > 1m30s
    srcs: [
        "dns_responder/dns_responder.cpp",
@@ -120,12 +155,10 @@ cc_test {
    //stl: "libc++_static",
    shared_libs: [
        "libbinder_ndk",
        "liblog",
        "libnetd_client",
    ],
    static_libs: [
        "dnsresolver_aidl_interface-unstable-ndk_platform",
        "libbase",
        "libbpf_android",
        "libcrypto_static",
        "libgmock",
@@ -156,13 +189,9 @@ cc_test_library {
    srcs: [
        "resolv_stats_test_utils.cpp"
    ],
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    export_include_dirs: ["."],
    shared_libs: [
        "liblog",
    ],
    static_libs: [
        "libbase",
        "libgmock",
        "libnetdutils",
        "libprotobuf-cpp-lite",
@@ -175,13 +204,9 @@ cc_test {
    srcs: [
        "resolv_stats_test_utils_test.cpp",
    ],
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    test_suites: ["device-tests"],
    shared_libs: [
        "liblog",
    ],
    static_libs: [
        "libbase",
        "libgmock",
        "libprotobuf-cpp-lite",
        "resolv_stats_test_utils",
+1 −2
Original line number Diff line number Diff line
cc_test_library {
    name: "libnetd_test_metrics_listener",
    defaults: ["netd_defaults"],
    defaults: ["netd_defaults", "resolv_test_defaults"],
    srcs: [
        "base_metrics_listener.cpp",
        "dns_metrics_listener.cpp",
@@ -10,7 +10,6 @@ cc_test_library {
        "libbinder_ndk",
    ],
    static_libs: [
        "libbase",
        "libutils",
        "netd_event_listener_interface-ndk_platform",
    ],
+7 −0
Original line number Diff line number Diff line
@@ -57,6 +57,13 @@ class DnsMetricsListener : public BaseMetricsListener {
    // Wait for the expected private DNS validation result until timeout.
    bool waitForPrivateDnsValidation(const std::string& serverAddr, const bool validated);

    // Return true if a validation result for |serverAddr| is found; otherwise, return false.
    // Only exists for testing.
    bool findValidationRecord(const std::string& serverAddr) const EXCLUDES(mMutex) {
        std::lock_guard lock(mMutex);
        return mValidationRecords.find({mNetId, serverAddr}) != mValidationRecords.end();
    }

  private:
    typedef std::pair<int32_t, std::string> ServerKey;

Loading