Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
test CD bit forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed May 22, 2024
1 parent c50b282 commit 8f41487
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mod section_3_2_2;

use dns_test::{
client::{Client, DigSettings},
name_server::NameServer,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use dns_test::{
client::{Client, DigSettings},
name_server::NameServer,
record::RecordType,
zone_file::Root,
Network, Resolver, Result, FQDN,
};

#[test]
fn copies_cd_bit_from_query_to_response() -> Result<()> {
let network = &Network::new()?;
let ns = NameServer::new(&dns_test::PEER, FQDN::ROOT, network)?.start()?;
let resolver = Resolver::new(network, Root::new(ns.fqdn().clone(), ns.ipv4_addr()))
.start(&dns_test::SUBJECT)?;

let client = Client::new(network)?;
let settings = *DigSettings::default().checking_disabled().recurse();
let ans = client.dig(settings, resolver.ipv4_addr(), RecordType::SOA, &FQDN::ROOT)?;

assert!(ans.flags.checking_disabled);

Ok(())
}

0 comments on commit 8f41487

Please sign in to comment.