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

Commit 83e8e930 authored by Victor Chang's avatar Victor Chang Committed by Gerrit Code Review
Browse files

Merge "Revert "[Test] Update test to comply with etc/hosts change.""

parents 84901a41 c63c3a1d
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -750,17 +750,11 @@ TEST_F(ResolverTest, GetAddrInfo_localhost) {
    StartDns(dns, {});
    ASSERT_TRUE(mDnsClient.SetResolversForNetwork());

    addrinfo hints = {.ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM};
    ScopedAddrinfo result = safe_getaddrinfo(kLocalHost, nullptr, &hints);
    ScopedAddrinfo result = safe_getaddrinfo(kLocalHost, nullptr, nullptr);
    EXPECT_TRUE(result != nullptr);
    // Expect no DNS queries; localhost is resolved via /etc/hosts
    EXPECT_TRUE(dns.queries().empty()) << dns.dumpQueries();
    if (android::modules::sdklevel::IsAtLeastU()) {
        // ::1 is added since U.
        EXPECT_THAT(ToStrings(result), testing::ElementsAre(kLocalHostAddr, kIp6LocalHostAddr));
    } else {
    EXPECT_EQ(kLocalHostAddr, ToString(result));
    }

    result = safe_getaddrinfo(kIp6LocalHost, nullptr, nullptr);
    EXPECT_TRUE(result != nullptr);