[PR #2440] [CLOSED] Record and replay traffic from tests against internet DNS servers #3044

Closed
opened 2026-03-16 11:22:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2440
Author: @divergentdave
Created: 9/7/2024
Status: Closed

Base: mainHead: david/record-internet-tests


📝 Commits (4)

  • 28361bd Initial implementation of internet traffic replay
  • b604b2a Add support for TCP
  • 5976098 Use recorder in unit tests
  • 3bdb6cc Use localhost in UDP timeout tests

📊 Changes

54 files changed (+38197 additions, -74 deletions)

View changed files

📝 Cargo.lock (+33 -0)
📝 Cargo.toml (+3 -0)
📝 crates/client/Cargo.toml (+1 -0)
📝 crates/client/src/client/async_client.rs (+12 -1)
📝 crates/proto/src/rr/rdata/sshfp.rs (+13 -13)
📝 crates/resolver/src/name_server/name_server.rs (+12 -1)
📝 crates/resolver/src/name_server/name_server_pool.rs (+16 -1)
📝 tests/integration-tests/tests/integration/client_future_tests.rs (+32 -9)
📝 tests/integration-tests/tests/integration/client_tests.rs (+141 -29)
📝 tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs (+77 -20)
tests/test-data/recordings/async_client_google_example_com.json (+95 -0)
tests/test-data/recordings/client_future_tests_test_query_tcp_ipv4_all_algos.json (+184 -0)
tests/test-data/recordings/client_future_tests_test_query_tcp_ipv4_no_ed25519.json (+184 -0)
tests/test-data/recordings/client_future_tests_test_query_udp_ipv4_all_algos.json (+289 -0)
tests/test-data/recordings/client_future_tests_test_query_udp_ipv4_no_ed25519.json (+289 -0)
tests/test-data/recordings/client_tests_test_nsec3_no_data_all_algos.json (+1586 -0)
tests/test-data/recordings/client_tests_test_nsec3_no_data_no_ed25519.json (+1564 -0)
tests/test-data/recordings/client_tests_test_nsec3_nxdomain_all_algos.json (+2330 -0)
tests/test-data/recordings/client_tests_test_nsec3_nxdomain_no_ed25519.json (+2298 -0)
tests/test-data/recordings/client_tests_test_nsec3_query_name_is_soa_name_all_algos.json (+2155 -0)

...and 34 more files

📄 Description

This addresses #2279 by adding a test utility that can save and replay transactions with internet-based DNS servers. If the environment variable DNS_RECORDER is set to record, it will make a connection to the remote server, record everything it proxies, and save it to a JSON file. By default, if the environment variable is not set, it will read from that file, and replay responses to matching queries. If text2pcap and tshark is present, they will be used to dissect the messages, and the dissection is saved alongside the raw bytes, to help explain changes when a test is re-recorded.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/2440 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 9/7/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `david/record-internet-tests` --- ### 📝 Commits (4) - [`28361bd`](https://github.com/hickory-dns/hickory-dns/commit/28361bdea3ceea2e81521902e0cf770a0b6f96a7) Initial implementation of internet traffic replay - [`b604b2a`](https://github.com/hickory-dns/hickory-dns/commit/b604b2a564523376aea36b22aa8cdb8f20817243) Add support for TCP - [`5976098`](https://github.com/hickory-dns/hickory-dns/commit/59760987786887ae3351d2ad31491b8dcb1ed814) Use recorder in unit tests - [`3bdb6cc`](https://github.com/hickory-dns/hickory-dns/commit/3bdb6cc0797d06740cf5683204cc078bfc218468) Use localhost in UDP timeout tests ### 📊 Changes **54 files changed** (+38197 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+33 -0) 📝 `Cargo.toml` (+3 -0) 📝 `crates/client/Cargo.toml` (+1 -0) 📝 `crates/client/src/client/async_client.rs` (+12 -1) 📝 `crates/proto/src/rr/rdata/sshfp.rs` (+13 -13) 📝 `crates/resolver/src/name_server/name_server.rs` (+12 -1) 📝 `crates/resolver/src/name_server/name_server_pool.rs` (+16 -1) 📝 `tests/integration-tests/tests/integration/client_future_tests.rs` (+32 -9) 📝 `tests/integration-tests/tests/integration/client_tests.rs` (+141 -29) 📝 `tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs` (+77 -20) ➕ `tests/test-data/recordings/async_client_google_example_com.json` (+95 -0) ➕ `tests/test-data/recordings/client_future_tests_test_query_tcp_ipv4_all_algos.json` (+184 -0) ➕ `tests/test-data/recordings/client_future_tests_test_query_tcp_ipv4_no_ed25519.json` (+184 -0) ➕ `tests/test-data/recordings/client_future_tests_test_query_udp_ipv4_all_algos.json` (+289 -0) ➕ `tests/test-data/recordings/client_future_tests_test_query_udp_ipv4_no_ed25519.json` (+289 -0) ➕ `tests/test-data/recordings/client_tests_test_nsec3_no_data_all_algos.json` (+1586 -0) ➕ `tests/test-data/recordings/client_tests_test_nsec3_no_data_no_ed25519.json` (+1564 -0) ➕ `tests/test-data/recordings/client_tests_test_nsec3_nxdomain_all_algos.json` (+2330 -0) ➕ `tests/test-data/recordings/client_tests_test_nsec3_nxdomain_no_ed25519.json` (+2298 -0) ➕ `tests/test-data/recordings/client_tests_test_nsec3_query_name_is_soa_name_all_algos.json` (+2155 -0) _...and 34 more files_ </details> ### 📄 Description This addresses #2279 by adding a test utility that can save and replay transactions with internet-based DNS servers. If the environment variable `DNS_RECORDER` is set to `record`, it will make a connection to the remote server, record everything it proxies, and save it to a JSON file. By default, if the environment variable is not set, it will read from that file, and replay responses to matching queries. If `text2pcap` and `tshark` is present, they will be used to dissect the messages, and the dissection is saved alongside the raw bytes, to help explain changes when a test is re-recorded. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:22:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3044
No description provided.