Lines Matching defs:dns
139 // If DNS reporting is off: turn it on so we run through everything.
202 size_t GetNumQueries(const test::DNSResponder& dns, const char* name) const {
203 auto queries = dns.queries();
213 size_t GetNumQueriesForType(const test::DNSResponder& dns, ns_type type,
215 auto queries = dns.queries();
228 std::vector<std::unique_ptr<test::DNSResponder>> dns;
232 ASSERT_NO_FATAL_FAILURE(SetupDNSServers(MAXNS, mappings, &dns, &servers));
266 ASSERT_NO_FATAL_FAILURE(ShutdownDNSServers(&dns));
280 test::DNSResponder dns(listen_addr, listen_srv, 250, ns_rcode::ns_r_servfail, 1.0);
281 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.3");
282 ASSERT_TRUE(dns.startServer());
288 dns.clearQueries();
290 EXPECT_EQ(1U, GetNumQueriesForType(dns, ns_type::ns_t_a, nonexistent_host_name));
294 dns.clearQueries();
296 EXPECT_EQ(1U, GetNumQueriesForType(dns, ns_type::ns_t_a, host_name));
303 dns.stopServer();
326 std::vector<std::unique_ptr<test::DNSResponder>> dns;
330 ASSERT_NO_FATAL_FAILURE(SetupDNSServers(4, mappings, &dns, &servers));
337 size_t total_queries = std::accumulate(dns.begin(), dns.end(), 0,
368 ASSERT_NO_FATAL_FAILURE(ShutdownDNSServers(&dns));
378 test::DNSResponder dns(listen_addr, listen_srv, 250,
380 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.4");
381 dns.addMapping(host_name, ns_type::ns_t_aaaa, "::1.2.3.4");
382 ASSERT_TRUE(dns.startServer());
393 dns.clearQueries();
397 size_t found = GetNumQueries(dns, host_name);
412 found = GetNumQueries(dns, host_name);
423 // Change the DNS resolver, ensure that queries are still cached.
426 dns.clearQueries();
430 found = GetNumQueries(dns, host_name);
444 dns.stopServer();
454 test::DNSResponder dns(listen_addr, listen_srv, 250,
456 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.5");
457 ASSERT_TRUE(dns.startServer());
465 EXPECT_EQ(1U, GetNumQueries(dns, host_name));
478 test::DNSResponder dns(listen_addr, listen_srv, 250,
480 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.3");
481 ASSERT_TRUE(dns.startServer());
485 dns.clearQueries();
487 EXPECT_EQ(1U, GetNumQueriesForType(dns, ns_type::ns_t_a, host_name));
493 dns.stopServer();
640 test::DNSResponder dns(listen_addr, listen_srv, 250,
642 dns.addMapping(host_name1, ns_type::ns_t_aaaa, "2001:db8::13");
643 dns.addMapping(host_name2, ns_type::ns_t_aaaa, "2001:db8::1:13");
644 ASSERT_TRUE(dns.startServer());
653 EXPECT_EQ(1U, dns.queries().size());
654 EXPECT_EQ(1U, GetNumQueries(dns, host_name1));
661 dns.clearQueries();
664 EXPECT_EQ(1U, dns.queries().size());
665 EXPECT_EQ(1U, GetNumQueries(dns, host_name2));
674 std::vector<std::unique_ptr<test::DNSResponder>> dns;
678 ASSERT_NO_FATAL_FAILURE(SetupDNSServers(MAXNS + 1, mappings, &dns, &servers));
689 ASSERT_NO_FATAL_FAILURE(ShutdownDNSServers(&dns));
706 test::DNSResponder dns(listen_addr, listen_srv, 250, ns_rcode::ns_r_servfail, 1.0);
707 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.3");
708 ASSERT_TRUE(dns.startServer());
723 dns.stopServer();
732 test::DNSResponder dns(listen_addr, listen_srv, 250, ns_rcode::ns_r_servfail, 1.0);
733 dns.addMapping(host_name1, ns_type::ns_t_a, "1.2.3.1");
734 dns.addMapping(host_name2, ns_type::ns_t_a, "1.2.3.2");
735 ASSERT_TRUE(dns.startServer());
738 // Bind the specified private DNS socket but don't respond to any client sockets yet.
778 dns.stopServer();
789 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
790 dns.addMapping(host_name1, ns_type::ns_t_a, "1.2.3.1");
791 dns.addMapping(host_name2, ns_type::ns_t_a, "1.2.3.2");
792 dns.addMapping(host_name3, ns_type::ns_t_a, "1.2.3.3");
793 ASSERT_TRUE(dns.startServer());
829 dns.stopServer();
837 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
838 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.1");
839 ASSERT_TRUE(dns.startServer());
862 dns.stopServer();
870 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
871 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.1");
872 ASSERT_TRUE(dns.startServer());
899 dns.stopServer();
909 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
910 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.1");
911 ASSERT_TRUE(dns.startServer());
936 dns.stopServer();
945 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
946 dns.addMapping(host_name1, ns_type::ns_t_a, "1.2.3.1");
947 dns.addMapping(host_name2, ns_type::ns_t_a, "1.2.3.2");
948 ASSERT_TRUE(dns.startServer());
980 dns.stopServer();
1050 test::DNSResponder dns(listen_addr, listen_udp, 250, ns_rcode::ns_r_servfail, 1.0);
1051 dns.addMapping(host_name, ns_type::ns_t_a, "1.2.3.4");
1052 dns.addMapping(host_name, ns_type::ns_t_aaaa, "::1.2.3.4");
1053 ASSERT_TRUE(dns.startServer());
1065 dns.clearQueries();
1068 size_t found = GetNumQueries(dns, host_name);
1084 dns.stopServer();