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

Commit c5ad9b6a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8310876 from f80afed1 to mainline-adservices-release

Change-Id: I662d5ce5388f285ff43d582b2679d989e676aeef
parents a1f9994b f80afed1
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -332,7 +332,8 @@ void maybeLogQuery(int eventType, const android_net_context& netContext,
void reportDnsEvent(int eventType, const android_net_context& netContext, int latencyUs,
                    int returnCode, NetworkDnsEventReported& event, const std::string& query_name,
                    const std::vector<std::string>& ip_addrs = {}, int total_ip_addr_count = 0) {
    uint32_t rate = (query_name.ends_with(".local") &&
    uint32_t rate =
            (query_name.ends_with(".local") && is_mdns_supported_network(netContext.dns_netid) &&
             android::net::Experiments::getInstance()->getFlag("mdns_resolution", 1))
                    ? getDnsEventSubsamplingRate(netContext.dns_netid, returnCode, true)
                    : getDnsEventSubsamplingRate(netContext.dns_netid, returnCode, false);
@@ -1158,7 +1159,9 @@ void DnsProxyListener::GetHostByNameHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYNAME);

    LOG(DEBUG) << "GetHostByNameHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByNameHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {
@@ -1313,7 +1316,9 @@ void DnsProxyListener::GetHostByAddrHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYADDR);

    LOG(DEBUG) << "GetHostByAddrHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByAddrHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <gtest/gtest.h>

#include "DnsQueryLog.h"
#include "tests/resolv_test_base.h"

using namespace std::chrono_literals;

@@ -58,7 +59,7 @@ void verifyDumpOutput(const std::string& dumpLog, const std::vector<int>& expect

}  // namespace

class DnsQueryLogTest : public ::testing::Test {
class DnsQueryLogTest : public ResolvTestBase {
  protected:
    const std::vector<std::string> serversV4 = {"127.0.0.1", "1.2.3.4"};
    const std::vector<std::string> serversV4V6 = {"127.0.0.1", "1.2.3.4", "2001:db8::1",
+3 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <gtest/gtest.h>

#include "DnsStats.h"
#include "tests/resolv_test_base.h"

namespace android::net {

@@ -66,7 +67,7 @@ StatsData makeStatsData(const IPSockAddr& server, const int total, const microse

// TODO: add StatsDataTest to ensure its methods return correct outputs.

class StatsRecordsTest : public ::testing::Test {};
class StatsRecordsTest : public ResolvTestBase {};

TEST_F(StatsRecordsTest, PushRecord) {
    const IPSockAddr server = IPSockAddr::toIPSockAddr("127.0.0.2", 53);
@@ -104,7 +105,7 @@ TEST_F(StatsRecordsTest, PushRecord) {
              makeStatsData(server, 3, 750ms, {{NS_R_NO_ERROR, 0}, {NS_R_TIMEOUT, 3}}));
}

class DnsStatsTest : public ::testing::Test {
class DnsStatsTest : public ResolvTestBase {
  protected:
    std::string captureDumpOutput() {
        netdutils::DumpWriter dw(STDOUT_FILENO);
+2 −1
Original line number Diff line number Diff line
@@ -25,10 +25,11 @@
#include <gtest/gtest.h>

#include "Experiments.h"
#include "tests/resolv_test_base.h"

namespace android::net {

class ExperimentsTest : public ::testing::Test {
class ExperimentsTest : public ResolvTestBase {
  public:
    ExperimentsTest() : mExperiments(fakeGetExperimentFlagInt) {}

+2 −1
Original line number Diff line number Diff line
@@ -20,13 +20,14 @@
#include "PrivateDnsConfiguration.h"
#include "tests/dns_responder/dns_responder.h"
#include "tests/dns_responder/dns_tls_frontend.h"
#include "tests/resolv_test_base.h"
#include "tests/resolv_test_utils.h"

namespace android::net {

using namespace std::chrono_literals;

class PrivateDnsConfigurationTest : public ::testing::Test {
class PrivateDnsConfigurationTest : public ResolvTestBase {
  public:
    using ServerIdentity = PrivateDnsConfiguration::ServerIdentity;

Loading