This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from ferrous-systems/ja-hickory-name-server-ta…
…ke-2 support Hickory in the NameServer role
- Loading branch information
Showing
11 changed files
with
106 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![cfg(test)] | ||
|
||
mod name_server; | ||
mod resolver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod rfc4035; | ||
mod scenarios; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod section_3; |
1 change: 1 addition & 0 deletions
1
packages/conformance-tests/src/name_server/rfc4035/section_3.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod section_3_1; |
1 change: 1 addition & 0 deletions
1
packages/conformance-tests/src/name_server/rfc4035/section_3/section_3_1.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod section_3_1_1; |
64 changes: 64 additions & 0 deletions
64
packages/conformance-tests/src/name_server/rfc4035/section_3/section_3_1/section_3_1_1.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use dns_test::client::{Client, DigSettings}; | ||
use dns_test::name_server::NameServer; | ||
use dns_test::record::{Record, RecordType}; | ||
use dns_test::{Network, Result, FQDN}; | ||
|
||
#[test] | ||
#[ignore] | ||
fn rrsig_in_answer_section() -> Result<()> { | ||
let network = Network::new()?; | ||
|
||
let ns = NameServer::new(&dns_test::subject(), FQDN::ROOT, &network)? | ||
.sign()? | ||
.start()?; | ||
|
||
let client = Client::new(&network)?; | ||
let ns_fqdn = ns.fqdn(); | ||
let ans = client.dig( | ||
*DigSettings::default().dnssec(), | ||
ns.ipv4_addr(), | ||
RecordType::A, | ||
ns_fqdn, | ||
)?; | ||
|
||
assert!(ans.status.is_noerror()); | ||
let [a, rrsig] = ans.answer.try_into().unwrap(); | ||
|
||
assert!(matches!(a, Record::A(..))); | ||
let rrsig = rrsig.try_into_rrsig().unwrap(); | ||
assert_eq!(RecordType::A, rrsig.type_covered); | ||
assert_eq!(ns_fqdn, &rrsig.fqdn); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
#[ignore] | ||
fn rrsig_in_authority_section() -> Result<()> { | ||
let network = Network::new()?; | ||
|
||
let ns = NameServer::new(&dns_test::subject(), FQDN::ROOT, &network)? | ||
.sign()? | ||
.start()?; | ||
|
||
let client = Client::new(&network)?; | ||
let ans = client.dig( | ||
*DigSettings::default().dnssec(), | ||
ns.ipv4_addr(), | ||
RecordType::SOA, | ||
&FQDN::ROOT, | ||
)?; | ||
|
||
assert!(ans.status.is_noerror()); | ||
let [ns, rrsig] = ans.authority.try_into().unwrap(); | ||
|
||
assert!(matches!(ns, Record::NS(..))); | ||
let rrsig = rrsig.try_into_rrsig().unwrap(); | ||
assert_eq!(RecordType::NS, rrsig.type_covered); | ||
assert_eq!(FQDN::ROOT, rrsig.fqdn); | ||
|
||
Ok(()) | ||
} | ||
|
||
// TODO Additional section | ||
// TODO TC bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use dns_test::client::{Client, DigSettings}; | ||
use dns_test::name_server::NameServer; | ||
use dns_test::record::RecordType; | ||
use dns_test::{Network, Result, FQDN}; | ||
|
||
#[test] | ||
fn authoritative_answer() -> Result<()> { | ||
let network = &Network::new()?; | ||
let ns = NameServer::new(&dns_test::subject(), FQDN::ROOT, network)?.start()?; | ||
|
||
let client = Client::new(network)?; | ||
let ans = client.dig( | ||
DigSettings::default(), | ||
ns.ipv4_addr(), | ||
RecordType::SOA, | ||
&FQDN::ROOT, | ||
)?; | ||
|
||
assert!(ans.status.is_noerror()); | ||
assert!(ans.flags.authoritative_answer); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/dns-test/src/templates/hickory.name-server.toml.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[zones]] | ||
zone = "{{ fqdn }}" | ||
zone_type = "Primary" | ||
file = "/etc/zones/main.zone" |