Lines Matching refs:host_name
257 dns.addMapping(r.host_name, r.type, r.addr); in StartDns()
479 constexpr char host_name[] = "host.example.com."; in TEST_F() local
489 {"e.example.com.", ns_type::ns_t_cname, host_name}, in TEST_F()
490 {host_name, ns_type::ns_t_a, "1.2.3.3"}, in TEST_F()
491 {host_name, ns_type::ns_t_aaaa, "2001:db8::42"}, in TEST_F()
503 std::string domain_name = records[i].host_name.substr(0, records[i].host_name.size() - 1); in TEST_F()
521 std::string domain_name = records[i].host_name.substr(0, records[i].host_name.size() - 1); in TEST_F()
717 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
720 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
721 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
734 size_t found = GetNumQueries(dns, host_name); in TEST_F()
745 found = GetNumQueries(dns, host_name); in TEST_F()
758 found = GetNumQueries(dns, host_name); in TEST_F()
759 size_t found2 = GetNumQueries(dns2, host_name); in TEST_F()
1103 constexpr char host_name[] = "host.example.com."; in TEST_F() local
1111 {"e.example.com.", ns_type::ns_t_cname, host_name}, in TEST_F()
1112 {host_name, ns_type::ns_t_a, "1.2.3.3"}, in TEST_F()
1113 {host_name, ns_type::ns_t_aaaa, "2001:db8::42"}, in TEST_F()
1168 const char* host_name = "howdy.example.com."; in TEST_F() local
1171 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
1172 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
1181 const size_t hostname1_count_after_first_query = GetNumQueries(dns, host_name); in TEST_F()
1190 const size_t hostname1_count_after_second_query = GetNumQueries(dns, host_name); in TEST_F()
1212 constexpr char host_name[] = "nihao.example2.com."; in TEST_F() local
1216 StartDns(dns, {{host_name, ns_type::ns_t_a, "1.2.3.3"}}); in TEST_F()
1221 EXPECT_EQ(1U, GetNumQueriesForType(dns, ns_type::ns_t_a, host_name)); in TEST_F()
1230 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
1235 StartDns(dns, {{host_name, ns_type::ns_t_aaaa, "2001:db8::5"}}); in TEST_F()
1247 result = safe_getaddrinfo(host_name, nullptr, &hints); in TEST_F()
1255 const char* host_name = "ohayou.example.com."; in TEST_F() local
1260 StartDns(dns0, {{host_name, ns_type::ns_t_aaaa, "2001:db8::5"}}); in TEST_F()
1261 StartDns(dns1, {{host_name, ns_type::ns_t_aaaa, "2001:db8::6"}}); in TEST_F()
1289 EXPECT_EQ(0U, GetNumQueries(dns0, host_name)); in TEST_F()
1290 EXPECT_EQ(1U, GetNumQueries(dns1, host_name)); in TEST_F()
1358 constexpr char host_name[] = "konbanha.example.com."; in TEST_F() local
1363 StartDns(dns0, {{host_name, ns_type::ns_t_aaaa, "2001:db8::5"}}); in TEST_F()
1364 StartDns(dns1, {{host_name, ns_type::ns_t_aaaa, "2001:db8::6"}}); in TEST_F()
1365 StartDns(dns2, {{host_name, ns_type::ns_t_aaaa, "2001:db8::7"}}); in TEST_F()
2024 constexpr char host_name[] = "tlsmissing.example.com."; in TEST_F() local
2026 StartDns(dns, {{host_name, ns_type::ns_t_a, "1.2.3.3"}}); in TEST_F()
2209 constexpr char host_name[] = "badtlsname.example.com."; in TEST_F() local
2212 StartDns(dns, {{host_name, ns_type::ns_t_a, "1.2.3.1"}}); in TEST_F()
2235 constexpr char host_name[] = "addrinfotls.example.com."; in TEST_F() local
2237 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2238 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2253 size_t found = GetNumQueries(dns, host_name); in TEST_F()
2325 const char* host_name = testHostName.c_str(); in TEST_F() local
2326 dns.addMapping(host_name, ns_type::ns_t_a, ADDR4); in TEST_F()
2327 dns.addMapping(host_name, ns_type::ns_t_aaaa, ADDR6); in TEST_F()
2360 h_result = gethostbyname(host_name); in TEST_F()
2362 EXPECT_EQ(1U, GetNumQueriesForType(dns, ns_type::ns_t_a, host_name)); in TEST_F()
2370 ai_result = safe_getaddrinfo(host_name, nullptr, nullptr); in TEST_F()
2373 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
2380 EXPECT_EQ(0, android_getaddrinfofornet(host_name, /*servname=*/nullptr, in TEST_F()
2385 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
2401 constexpr char host_name[] = "strictmode.notlsips.example.com."; in TEST_F() local
2403 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2404 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2415 EXPECT_NE(0, getaddrinfo(host_name, nullptr, nullptr, &ai_result)); in TEST_F()
2416 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
2496 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2498 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2499 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2522 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
2539 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
2544 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2546 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2547 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2587 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2589 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2590 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2652 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2654 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2655 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2854 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2856 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2874 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
2887 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
2895 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
2901 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2903 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2904 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2934 EXPECT_EQ(2U, GetNumQueries(dns0, host_name) + GetNumQueries(dns1, host_name)); in TEST_F()
2952 EXPECT_EQ(4U, GetNumQueries(dns0, host_name)); in TEST_F()
2953 EXPECT_EQ(4U, GetNumQueries(dns1, host_name)); in TEST_F()
2958 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
2960 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
2961 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
2997 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
3025 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
3139 const char* host_name = testHostName.c_str(); in TEST_F() local
3140 dns.addMapping(host_name, ns_type::ns_t_a, ADDR4); in TEST_F()
3177 const hostent* h_result = gethostbyname(host_name); in TEST_F()
3179 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
3185 ExpectDnsEvent(INetdEventListener::EVENT_GETHOSTBYNAME, 0, host_name, {ADDR4}); in TEST_F()
3187 EXPECT_EQ(0U, GetNumQueriesForType(dns, ns_type::ns_t_a, host_name)); in TEST_F()
3191 ExpectDnsEvent(INetdEventListener::EVENT_GETHOSTBYNAME, returnCode, host_name, {}); in TEST_F()
3196 ai_result = safe_getaddrinfo(host_name, nullptr, &hints); in TEST_F()
3199 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
3202 ExpectDnsEvent(INetdEventListener::EVENT_GETADDRINFO, 0, host_name, {ADDR4}); in TEST_F()
3205 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
3207 ExpectDnsEvent(INetdEventListener::EVENT_GETADDRINFO, returnCode, host_name, {}); in TEST_F()
3286 constexpr char host_name[] = "v4only.example.com."; in TEST_F() local
3288 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3307 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
3319 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
3344 constexpr char host_name[] = "v4only.example.com."; in TEST_F() local
3346 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3390 constexpr char host_name[] = "v4only.example.com."; in TEST_F() local
3392 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3407 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
3415 EXPECT_EQ(0U /*cached in previous queries*/, GetNumQueries(dns, host_name)); in TEST_F()
3421 constexpr char host_name[] = "v4v6.example.com."; in TEST_F() local
3423 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3424 {host_name, ns_type::ns_t_aaaa, "2001:db8::1.2.3.4"}, in TEST_F()
3436 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
3444 constexpr char host_name[] = "v4v6.example.com."; in TEST_F() local
3446 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3458 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
3504 const char* host_name = testHostName.c_str(); in TEST_F() local
3505 dns.addMapping(host_name, ns_type::ns_t_a, config.addr.c_str()); in TEST_F()
3512 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
3521 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
3529 constexpr char host_name[] = "v4only.example.com."; in TEST_F() local
3532 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
3550 EXPECT_LE(2U, GetNumQueries(dns, host_name)); in TEST_F()
3728 constexpr char host_name[] = "localhost"; in TEST_F() local
3747 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
3754 EXPECT_EQ(result_str, host_name); in TEST_F()
3941 constexpr char host_name[] = "localhost"; in TEST_F() local
3963 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
3966 EXPECT_EQ(result_str, host_name); in TEST_F()
4005 constexpr char host_name[] = "ipv4only.example.com."; in TEST_F() local
4007 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4019 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
4025 constexpr char host_name[] = "v4v6.example.com."; in TEST_F() local
4028 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4029 {host_name, ns_type::ns_t_aaaa, "2001:db8::1.2.3.4"}, in TEST_F()
4041 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
4049 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
4096 const char* host_name = testHostName.c_str(); in TEST_F() local
4097 dns.addMapping(host_name, ns_type::ns_t_a, config.addr.c_str()); in TEST_F()
4100 EXPECT_LE(1U, GetNumQueries(dns, host_name)); in TEST_F()
4155 constexpr char host_name[] = "v4.example.com."; in TEST_F() local
4158 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4254 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4449 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
4451 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4452 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
4468 int fd1 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_a, 0); in TEST_F()
4469 int fd2 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_aaaa, 0); in TEST_F()
4497 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
4499 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4500 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
4516 {host_name, (isAtLeastT() && fs::exists(DNS_HELPER)) ? EAI_FAIL : EAI_NODATA}, in TEST_F()
4547 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
4549 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
4550 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
4570 const int fd1 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_a, 0); in TEST_F()
4571 const int fd2 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_aaaa, 0); in TEST_F()
4604 int fd1 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_a, 0); in TEST_F()
4605 int fd2 = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_aaaa, 0); in TEST_F()
6127 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
6129 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
6172 ScopedAddrinfo result = safe_getaddrinfo(host_name, nullptr, &hints); in TEST_F()
6175 int fd = resNetworkQuery(TEST_NETID, host_name, ns_c_in, ns_t_aaaa, 0); in TEST_F()
6194 constexpr char host_name[] = "howdy.example.com."; in TEST_F() local
6198 {host_name, ns_type::ns_t_a, "1.2.3.4"}, in TEST_F()
6199 {host_name, ns_type::ns_t_aaaa, "::1.2.3.4"}, in TEST_F()
6216 auto [result, timeTakenMs] = safe_getaddrinfo_time_taken(host_name, nullptr, hints); in TEST_F()
6221 EXPECT_EQ(2U, GetNumQueries(neverRespondDns, host_name)); in TEST_F()
6222 ExpectDnsEvent(INetdEventListener::EVENT_GETADDRINFO, RCODE_TIMEOUT, host_name, {}); in TEST_F()
6410 if (r.host_name == hostname) expectedAnswers.push_back(r.addr); in TEST_F()
6439 constexpr char host_name[] = "hello.local."; in TEST_F() local
6443 mdnsv4.addMapping(host_name, ns_type::ns_t_a, v4addr); in TEST_F()
6445 mdnsv6.addMapping(host_name, ns_type::ns_t_aaaa, v6addr); in TEST_F()
6485 EXPECT_EQ(1U, GetNumQueries(mdns, host_name)); in TEST_F()
6538 constexpr char host_name[] = "hello.local."; in TEST_F() local
6542 mdnsv4.addMapping(host_name, ns_type::ns_t_a, v4addr); in TEST_F()
6543 mdnsv6.addMapping(host_name, ns_type::ns_t_aaaa, v6addr); in TEST_F()
6548 {host_name, ns_type::ns_t_a, v4addr}, in TEST_F()
6549 {host_name, ns_type::ns_t_aaaa, v6addr}, in TEST_F()
6577 EXPECT_EQ(1U, GetNumQueries(mdns, host_name)); in TEST_F()
6578 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
6580 EXPECT_EQ(0U, GetNumQueries(mdns, host_name)); in TEST_F()
6581 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
6599 constexpr char host_name[] = "hello.local."; in TEST_F() local
6606 {"e.local.", ns_type::ns_t_cname, host_name}, in TEST_F()
6607 {host_name, ns_type::ns_t_a, v4addr}, in TEST_F()
6608 {host_name, ns_type::ns_t_aaaa, v6addr}, in TEST_F()
6612 mdnsv4.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6616 mdnsv6.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6643 records[i].host_name.substr(0, records[i].host_name.size() - 1); in TEST_F()
6671 mdnsv4.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6674 mdnsv6.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6693 constexpr char host_name[] = "hello.local."; in TEST_F() local
6696 mdnsv4.addMapping(host_name, ns_type::ns_t_a, v4addr); in TEST_F()
6697 mdnsv6.addMapping(host_name, ns_type::ns_t_aaaa, v6addr); in TEST_F()
6728 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6731 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6734 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6735 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6747 EXPECT_EQ(0U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6749 EXPECT_EQ(0U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6751 EXPECT_EQ(0U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6752 EXPECT_EQ(0U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6765 constexpr char host_name[] = "hello.local."; in TEST_F() local
6768 mdnsv4.addMapping(host_name, ns_type::ns_t_a, v4addr); in TEST_F()
6769 mdnsv6.addMapping(host_name, ns_type::ns_t_aaaa, v6addr); in TEST_F()
6774 {host_name, ns_type::ns_t_a, v4addr}, in TEST_F()
6775 {host_name, ns_type::ns_t_aaaa, v6addr}, in TEST_F()
6803 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6804 EXPECT_EQ(0U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6806 EXPECT_EQ(0U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6807 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6809 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6810 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6812 EXPECT_EQ(0U, GetNumQueries(dns, host_name)); in TEST_F()
6814 EXPECT_EQ(0U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6815 EXPECT_EQ(0U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6817 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
6819 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
6836 constexpr char host_name[] = "hello.local."; in TEST_F() local
6839 mdnsv6.addMapping(host_name, ns_type::ns_t_aaaa, v6addr); in TEST_F()
6859 constexpr char host_name[] = "hello.local."; in TEST_F() local
6868 {"e.local.", ns_type::ns_t_cname, host_name}, in TEST_F()
6869 {host_name, ns_type::ns_t_a, v4addr}, in TEST_F()
6870 {host_name, ns_type::ns_t_aaaa, v6addr}, in TEST_F()
6873 mdnsv4.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6876 mdnsv6.addMapping(r.host_name, r.type, r.addr); in TEST_F()
6901 constexpr char host_name[] = "hello.local."; in TEST_F() local
6904 mdnsv4.addMapping(host_name, ns_type::ns_t_cname, "a.local."); in TEST_F()
6905 mdnsv6.addMapping(host_name, ns_type::ns_t_cname, "a.local."); in TEST_F()
6926 constexpr char host_name[] = "hello.local."; in TEST_F() local
6929 mdnsv4.addMapping(host_name, ns_type::ns_t_cname, ".!#?"); in TEST_F()
6930 mdnsv6.addMapping(host_name, ns_type::ns_t_cname, ".!#?"); in TEST_F()
6954 constexpr char host_name[] = "hello.local."; in TEST_F() local
6965 {host_name, ns_type::ns_t_a, v4addr}, in TEST_F()
6966 {host_name, ns_type::ns_t_aaaa, v6addr}, in TEST_F()
6987 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6988 EXPECT_EQ(0U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6989 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
6991 EXPECT_EQ(0U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6992 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6993 EXPECT_EQ(1U, GetNumQueries(dns, host_name)); in TEST_F()
6995 EXPECT_EQ(1U, GetNumQueries(mdnsv4, host_name)); in TEST_F()
6996 EXPECT_EQ(1U, GetNumQueries(mdnsv6, host_name)); in TEST_F()
6997 EXPECT_EQ(2U, GetNumQueries(dns, host_name)); in TEST_F()
7248 const char* host_name,
7253 const char* host_name, size_t count, unsigned expectedDnsNetId) { in expectDnsQueryCountsFn() argument
7254 EXPECT_EQ(GetNumQueries(*dnsServer, host_name), count); in expectDnsQueryCountsFn()
7335 ConnectivityType type, ScopedNetwork* nw, const char* host_name, const char* ipv4_addr, in setupDns() argument
7343 {{host_name, ns_type::ns_t_a, ipv4_addr}, {host_name, ns_type::ns_t_aaaa, ipv6_addr}}); in setupDns()
7433 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7451 StartDns(*dnsPair->dnsServer, {{host_name, ns_type::ns_t_a, "192.0.2.0"}, in TEST_F()
7452 {host_name, ns_type::ns_t_aaaa, "2001:db8:cafe:d00d::31"}}); in TEST_F()
7458 auto result = android_getaddrinfofornet_wrapper(host_name, network.netId()); in TEST_F()
7474 EXPECT_EQ(GetNumQueries(*dnsPair->dnsServer, host_name), expectedQueries); in TEST_F()
7479 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7503 int fd = resNetworkQuery(network->netId(), host_name, ns_c_in, ns_t_a, 0); in TEST_F()
7509 const auto condition = [&]() { return GetNumQueries(*dnsPair->dnsServer, host_name) == 1U; }; in TEST_F()
7518 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7529 StartDns(*dnsPair1->dnsServer, {{host_name, ns_type::ns_t_a, "192.0.2.0"}}); in TEST_F()
7530 StartDns(*dnsPair2->dnsServer, {{host_name, ns_type::ns_t_a, "192.0.2.1"}}); in TEST_F()
7541 int fd1 = resNetworkQuery(network1.netId(), host_name, ns_c_in, ns_t_a, 0); in TEST_F()
7542 int fd2 = resNetworkQuery(network2.netId(), host_name, ns_c_in, ns_t_a, 0); in TEST_F()
7546 EXPECT_EQ(GetNumQueries(*dnsPair1->dnsServer, host_name), 1U); in TEST_F()
7547 EXPECT_EQ(GetNumQueries(*dnsPair2->dnsServer, host_name), 1U); in TEST_F()
7551 fd1 = resNetworkQuery(network1.netId(), host_name, ns_c_in, ns_t_a, 0); in TEST_F()
7552 fd2 = resNetworkQuery(network2.netId(), host_name, ns_c_in, ns_t_a, 0); in TEST_F()
7556 EXPECT_EQ(GetNumQueries(*dnsPair1->dnsServer, host_name), 2U); in TEST_F()
7557 EXPECT_EQ(GetNumQueries(*dnsPair2->dnsServer, host_name), 1U); in TEST_F()
7563 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7589 setupDns(type, &underlyingNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7592 setupDns(type, &bypassableVpnNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7594 auto secureVpnDnsSv = setupDns(type, &secureVpnNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7628 expectDnsWorksForUid(host_name, config.selectedNetwork->netId(), TEST_UID, result); in TEST_F()
7629 expectDnsQueryCountsFn(config.expectedDnsServer, host_name, result.size(), in TEST_F()
7641 expectDnsWorksForUid(host_name, selectedNetwork->netId(), TEST_UID, result); in TEST_F()
7642 expectDnsQueryCountsFn(*underlyingNwDnsSv, host_name, result.size(), underlyingNetId); in TEST_F()
7657 expectDnsWorksForUid(host_name, selectedNetwork->netId(), TEST_UID2, result); in TEST_F()
7658 expectDnsQueryCountsFn(*underlyingNwDnsSv, host_name, result.size(), in TEST_F()
7667 expectDnsWorksForUid(host_name, selectedNetwork->netId(), TEST_UID2, result); in TEST_F()
7668 expectDnsQueryCountsFn(*secureVpnDnsSv, host_name, result.size(), secureVpnNetId); in TEST_F()
7683 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7708 setupDns(ipVersion, &sysDefaultNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7711 setupDns(ipVersion, &appDefaultNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7713 auto vpnDnsSv = setupDns(ipVersion, &vpn, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7730 expectDnsWorksForUid(host_name, NETID_UNSET, TEST_UID, expectedDnsReply); in TEST_F()
7731 expectDnsQueryCountsFn(*sysDefaultNwDnsSv, host_name, expectedDnsReply.size(), in TEST_F()
7735 expectDnsWorksForUid(host_name, NETID_UNSET, TEST_UID, expectedDnsReply); in TEST_F()
7736 expectDnsQueryCountsFn(*appDefaultNwDnsSv, host_name, expectedDnsReply.size(), in TEST_F()
7758 expectDnsWorksForUid(host_name, config.selectedNetwork->netId(), TEST_UID, in TEST_F()
7760 expectDnsQueryCountsFn(config.expectedDnsServer, host_name, expectedDnsReply.size(), in TEST_F()
7766 expectDnsWorksForUid(host_name, vpn.netId(), TEST_UID, expectedDnsReply); in TEST_F()
7767 expectDnsQueryCountsFn(*vpnDnsSv, host_name, expectedDnsReply.size(), vpnNetId); in TEST_F()
7771 expectDnsWorksForUid(host_name, vpn.netId(), TEST_UID, expectedDnsReply); in TEST_F()
7772 expectDnsQueryCountsFn(*appDefaultNwDnsSv, host_name, expectedDnsReply.size(), in TEST_F()
7779 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7790 StartDns(*dnsPair->dnsServer, {{host_name, ns_type::ns_t_a, "192.0.2.0"}, in TEST_F()
7791 {host_name, ns_type::ns_t_aaaa, "2001:db8:cafe:d00d::31"}}); in TEST_F()
7796 auto result = android_getaddrinfofornet_wrapper(host_name, network.netId()); in TEST_F()
7800 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_a, host_name), 1U); in TEST_F()
7801 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_aaaa, host_name), 0U); in TEST_F()
7813 result = android_getaddrinfofornet_wrapper(host_name, network.netId()); in TEST_F()
7819 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_a, host_name), 1U); in TEST_F()
7820 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_aaaa, host_name), 1U); in TEST_F()
7831 constexpr char host_name[] = "hello.local."; in TEST_F() local
7853 StartDns(mdnsv4, {{host_name, ns_type::ns_t_a, v4addr}}); in TEST_F()
7854 StartDns(mdnsv6, {{host_name, ns_type::ns_t_aaaa, v6addr}}); in TEST_F()
7862 EXPECT_EQ(GetNumQueries(mdnsv4, host_name), 1U); in TEST_F()
7863 EXPECT_EQ(GetNumQueries(mdnsv6, host_name), 1U); in TEST_F()
7864 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_a, host_name), 0U); in TEST_F()
7865 EXPECT_EQ(GetNumQueriesForType(*dnsPair->dnsServer, ns_type::ns_t_aaaa, host_name), 0U); in TEST_F()
7928 constexpr char host_name[] = "ohayou.example.com."; in TEST_F() local
7953 setupDns(ipVersion, &sysDefaultNetwork, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7956 setupDns(ipVersion, &enterpriseNetwork_1, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7959 setupDns(ipVersion, &enterpriseNetwork_2, host_name, ipv4_addr, ipv6_addr); in TEST_F()
7975 expectDnsWorksForUid(host_name, NETID_UNSET, TEST_UID, expectedDnsReply); in TEST_F()
7976 expectDnsQueryCountsFn(*enterpriseNw1DnsSv, host_name, expectedDnsReply.size(), in TEST_F()
8014 expectDnsWorksForUid(host_name, cfg.selectedNetwork.netId(), cfg.uid, in TEST_F()
8017 expectDnsFailedForUid(host_name, cfg.selectedNetwork.netId(), cfg.uid); in TEST_F()
8027 expectDnsWorksForUid(host_name, cfg.selectedNetwork.netId(), cfg.uid, expectedDnsReply); in TEST_F()