From db53ec230d2de1b3be50230d4c00e83a03df686f Mon Sep 17 00:00:00 2001 From: Kaveh Date: Thu, 7 Nov 2024 03:19:32 +0330 Subject: refactor(ext/net): Use hickory dns instead of unmaintained trust-dns (#26741) This PR replaces the unmaintained and rebranded `trust-dns` to `hickory` for resolver in `deno_net`. --- tests/integration/run_tests.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/integration/run_tests.rs') diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index 686fbabcf..e29ecc486 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -16,12 +16,11 @@ use deno_tls::rustls; use deno_tls::rustls::ClientConnection; use deno_tls::rustls_pemfile; use deno_tls::TlsStream; +use hickory_client::serialize::txt::Parser; use pretty_assertions::assert_eq; use test_util as util; use test_util::itest; use test_util::TempDir; -use trust_dns_client::serialize::txt::Lexer; -use trust_dns_client::serialize::txt::Parser; use util::assert_contains; use util::assert_not_contains; use util::PathRef; @@ -2175,6 +2174,11 @@ fn basic_auth_tokens() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_resolve_dns() { + use hickory_server::authority::Catalog; + use hickory_server::authority::ZoneType; + use hickory_server::proto::rr::Name; + use hickory_server::store::in_memory::InMemoryAuthority; + use hickory_server::ServerFuture; use std::net::SocketAddr; use std::str::FromStr; use std::sync::Arc; @@ -2182,11 +2186,6 @@ async fn test_resolve_dns() { use tokio::net::TcpListener; use tokio::net::UdpSocket; use tokio::sync::oneshot; - use trust_dns_server::authority::Catalog; - use trust_dns_server::authority::ZoneType; - use trust_dns_server::proto::rr::Name; - use trust_dns_server::store::in_memory::InMemoryAuthority; - use trust_dns_server::ServerFuture; const DNS_PORT: u16 = 4553; @@ -2196,9 +2195,12 @@ async fn test_resolve_dns() { util::testdata_path().join("run/resolve_dns.zone.in"), ) .unwrap(); - let lexer = Lexer::new(&zone_file); - let records = - Parser::new().parse(lexer, Some(Name::from_str("example.com").unwrap())); + let records = Parser::new( + &zone_file, + None, + Some(Name::from_str("example.com").unwrap()), + ) + .parse(); if records.is_err() { panic!("failed to parse: {:?}", records.err()) } -- cgit v1.2.3