Merge pull request #14 from japaric/ja-hickory-source
support building hickory from a local/remote git source
This commit is contained in:
commit
9d3d405af5
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
env:
|
||||||
|
HICKORY_REV: a3669bd80f3f7b97f0c301c15f1cba6368d97b63
|
||||||
|
DNS_TEST_VERBOSE_DOCKER_BUILD: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
@ -27,12 +31,15 @@ jobs:
|
|||||||
run: cargo test -p conformance-tests -- --include-ignored
|
run: cargo test -p conformance-tests -- --include-ignored
|
||||||
|
|
||||||
- name: Run tests against hickory
|
- name: Run tests against hickory
|
||||||
run: DNS_TEST_SUBJECT=hickory cargo test -p conformance-tests
|
run: |
|
||||||
|
git clone https://github.com/hickory-dns/hickory-dns /tmp/hickory
|
||||||
|
( cd /tmp/hickory && git reset --hard ${{ env.HICKORY_REV }} )
|
||||||
|
DNS_TEST_SUBJECT="hickory /tmp/hickory" cargo test -p conformance-tests
|
||||||
|
|
||||||
- name: Check that ignored tests fail with hickory
|
- name: Check that ignored tests fail with hickory
|
||||||
run: |
|
run: |
|
||||||
tmpfile="$(mktemp)"
|
tmpfile="$(mktemp)"
|
||||||
DNS_TEST_SUBJECT=hickory cargo test -p conformance-tests -- --ignored | tee "$tmpfile"
|
DNS_TEST_SUBJECT="hickory /tmp/hickory" cargo test -p conformance-tests -- --ignored | tee "$tmpfile"
|
||||||
grep 'test result: FAILED. 0 passed' "$tmpfile" || ( echo "expected ALL tests to fail but at least one passed; the passing tests must be un-#[ignore]-d" && exit 1 )
|
grep 'test result: FAILED. 0 passed' "$tmpfile" || ( echo "expected ALL tests to fail but at least one passed; the passing tests must be un-#[ignore]-d" && exit 1 )
|
||||||
|
|
||||||
- name: Check that code is formatted
|
- name: Check that code is formatted
|
||||||
|
67
Cargo.lock
generated
67
Cargo.lock
generated
@ -142,6 +142,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -172,6 +173,15 @@ version = "1.0.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "form_urlencoded"
|
||||||
|
version = "1.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
|
||||||
|
dependencies = [
|
||||||
|
"percent-encoding",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.12.3"
|
version = "0.12.3"
|
||||||
@ -219,6 +229,16 @@ version = "1.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "idna"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-bidi",
|
||||||
|
"unicode-normalization",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "1.9.3"
|
version = "1.9.3"
|
||||||
@ -304,6 +324,12 @@ version = "1.19.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "percent-encoding"
|
||||||
|
version = "2.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -478,12 +504,53 @@ dependencies = [
|
|||||||
"time-core",
|
"time-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tinyvec"
|
||||||
|
version = "1.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
|
||||||
|
dependencies = [
|
||||||
|
"tinyvec_macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tinyvec_macros"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-bidi"
|
||||||
|
version = "0.3.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-normalization"
|
||||||
|
version = "0.1.22"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
|
||||||
|
dependencies = [
|
||||||
|
"tinyvec",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "url"
|
||||||
|
version = "2.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
|
||||||
|
dependencies = [
|
||||||
|
"form_urlencoded",
|
||||||
|
"idna",
|
||||||
|
"percent-encoding",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.91"
|
version = "0.2.91"
|
||||||
|
@ -11,6 +11,7 @@ serde = { version = "1.0.196", features = ["derive"] }
|
|||||||
serde_json = "1.0.113"
|
serde_json = "1.0.113"
|
||||||
serde_with = "3.6.1"
|
serde_with = "3.6.1"
|
||||||
tempfile = "3.9.0"
|
tempfile = "3.9.0"
|
||||||
|
url = "2.5.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
@ -13,7 +13,7 @@ pub struct Client {
|
|||||||
impl Client {
|
impl Client {
|
||||||
pub fn new(network: &Network) -> Result<Self> {
|
pub fn new(network: &Network) -> Result<Self> {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
inner: Container::run(Implementation::Unbound, network)?,
|
inner: Container::run(&Implementation::Unbound, network)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
mod network;
|
mod network;
|
||||||
|
|
||||||
use core::str;
|
use core::str;
|
||||||
use std::fs;
|
|
||||||
use std::net::Ipv4Addr;
|
use std::net::Ipv4Addr;
|
||||||
use std::process::{self, ChildStdout, ExitStatus};
|
use std::process::{self, ChildStdout, ExitStatus};
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::{atomic, Arc};
|
use std::sync::{atomic, Arc};
|
||||||
|
use std::{env, fs};
|
||||||
|
|
||||||
use tempfile::{NamedTempFile, TempDir};
|
use tempfile::{NamedTempFile, TempDir};
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ const PACKAGE_NAME: &str = env!("CARGO_PKG_NAME");
|
|||||||
|
|
||||||
impl Container {
|
impl Container {
|
||||||
/// Starts the container in a "parked" state
|
/// Starts the container in a "parked" state
|
||||||
pub fn run(implementation: Implementation, network: &Network) -> Result<Self> {
|
pub fn run(implementation: &Implementation, network: &Network) -> Result<Self> {
|
||||||
// TODO make this configurable and support hickory & bind
|
// TODO make this configurable and support hickory & bind
|
||||||
let dockerfile = implementation.dockerfile();
|
let dockerfile = implementation.dockerfile();
|
||||||
let docker_build_dir = TempDir::new()?;
|
let docker_build_dir = TempDir::new()?;
|
||||||
@ -37,14 +37,30 @@ impl Container {
|
|||||||
.arg(&image_tag)
|
.arg(&image_tag)
|
||||||
.arg(docker_build_dir);
|
.arg(docker_build_dir);
|
||||||
|
|
||||||
|
let repo = if let Implementation::Hickory(repo) = implementation {
|
||||||
|
Some(repo)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
implementation.once().call_once(|| {
|
implementation.once().call_once(|| {
|
||||||
let output = command.output().unwrap();
|
if let Some(repo) = repo {
|
||||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
let mut cp_r = Command::new("git");
|
||||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
cp_r.args([
|
||||||
assert!(
|
"clone",
|
||||||
output.status.success(),
|
"--depth",
|
||||||
"--- STDOUT ---\n{stdout}\n--- STDERR ---\n{stderr}"
|
"1",
|
||||||
);
|
repo.as_str(),
|
||||||
|
&docker_build_dir.join("src").display().to_string(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
exec_or_panic(&mut cp_r, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs::write(docker_build_dir.join(".dockerignore"), "src/.git")
|
||||||
|
.expect("could not create .dockerignore file");
|
||||||
|
|
||||||
|
exec_or_panic(&mut command, verbose_docker_build());
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut command = Command::new("docker");
|
let mut command = Command::new("docker");
|
||||||
@ -171,6 +187,25 @@ impl Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn verbose_docker_build() -> bool {
|
||||||
|
env::var("DNS_TEST_VERBOSE_DOCKER_BUILD").as_deref() == Ok("1")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn exec_or_panic(command: &mut Command, verbose: bool) {
|
||||||
|
if verbose {
|
||||||
|
let status = command.status().unwrap();
|
||||||
|
assert!(status.success());
|
||||||
|
} else {
|
||||||
|
let output = command.output().unwrap();
|
||||||
|
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||||
|
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||||
|
assert!(
|
||||||
|
output.status.success(),
|
||||||
|
"--- STDOUT ---\n{stdout}\n--- STDERR ---\n{stderr}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn container_count() -> usize {
|
fn container_count() -> usize {
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
@ -299,7 +334,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn run_works() -> Result<()> {
|
fn run_works() -> Result<()> {
|
||||||
let network = Network::new()?;
|
let network = Network::new()?;
|
||||||
let container = Container::run(Implementation::Unbound, &network)?;
|
let container = Container::run(&Implementation::Unbound, &network)?;
|
||||||
|
|
||||||
let output = container.output(&["true"])?;
|
let output = container.output(&["true"])?;
|
||||||
assert!(output.status.success());
|
assert!(output.status.success());
|
||||||
@ -310,7 +345,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn ipv4_addr_works() -> Result<()> {
|
fn ipv4_addr_works() -> Result<()> {
|
||||||
let network = Network::new()?;
|
let network = Network::new()?;
|
||||||
let container = Container::run(Implementation::Unbound, &network)?;
|
let container = Container::run(&Implementation::Unbound, &network)?;
|
||||||
let ipv4_addr = container.ipv4_addr();
|
let ipv4_addr = container.ipv4_addr();
|
||||||
|
|
||||||
let output = container.output(&["ping", "-c1", &format!("{ipv4_addr}")])?;
|
let output = container.output(&["ping", "-c1", &format!("{ipv4_addr}")])?;
|
||||||
@ -322,7 +357,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn cp_works() -> Result<()> {
|
fn cp_works() -> Result<()> {
|
||||||
let network = Network::new()?;
|
let network = Network::new()?;
|
||||||
let container = Container::run(Implementation::Unbound, &network)?;
|
let container = Container::run(&Implementation::Unbound, &network)?;
|
||||||
|
|
||||||
let path = "/tmp/somefile";
|
let path = "/tmp/somefile";
|
||||||
let contents = "hello";
|
let contents = "hello";
|
||||||
|
@ -146,7 +146,7 @@ mod tests {
|
|||||||
let network = Network::new().expect("Failed to create network");
|
let network = Network::new().expect("Failed to create network");
|
||||||
let network_name = network.name().to_string();
|
let network_name = network.name().to_string();
|
||||||
let container =
|
let container =
|
||||||
Container::run(Implementation::Unbound, &network).expect("Failed to start container");
|
Container::run(&Implementation::Unbound, &network).expect("Failed to start container");
|
||||||
|
|
||||||
assert!(exists_network(&network_name));
|
assert!(exists_network(&network_name));
|
||||||
drop(network);
|
drop(network);
|
||||||
|
@ -4,5 +4,9 @@ RUN apt-get update && \
|
|||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
tshark
|
tshark
|
||||||
|
|
||||||
RUN cargo install hickory-dns --version 0.24.0 --features recursor --debug
|
# `dns-test` will invoke `docker build` from a temporary directory that contains
|
||||||
|
# a clone of the hickory repository. `./src` here refers to that clone; not to
|
||||||
|
# any directory inside the `dns-test` repository
|
||||||
|
COPY ./src /usr/src/hickory
|
||||||
|
RUN cargo install --path /usr/src/hickory/bin --features recursor --debug
|
||||||
env RUST_LOG=debug
|
env RUST_LOG=debug
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
//! A test framework for all things DNS
|
//! A test framework for all things DNS
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
use std::borrow::Cow;
|
||||||
|
use std::path::Path;
|
||||||
use std::sync::Once;
|
use std::sync::Once;
|
||||||
|
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
pub use crate::container::Network;
|
pub use crate::container::Network;
|
||||||
pub use crate::fqdn::FQDN;
|
pub use crate::fqdn::FQDN;
|
||||||
pub use crate::resolver::Resolver;
|
pub use crate::resolver::Resolver;
|
||||||
@ -21,17 +25,43 @@ mod trust_anchor;
|
|||||||
pub mod tshark;
|
pub mod tshark;
|
||||||
pub mod zone_file;
|
pub mod zone_file;
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone)]
|
||||||
pub enum Implementation {
|
pub enum Implementation {
|
||||||
Unbound,
|
Unbound,
|
||||||
Hickory,
|
Hickory(Repository<'static>),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct Repository<'a> {
|
||||||
|
inner: Cow<'a, str>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Repository<'_> {
|
||||||
|
fn as_str(&self) -> &str {
|
||||||
|
&self.inner
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// checks that `input` looks like a valid repository which can be either local or remote
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// this function panics if `input` is not a local `Path` that exists or a well-formed URL
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
pub fn Repository(input: impl Into<Cow<'static, str>>) -> Repository<'static> {
|
||||||
|
let input = input.into();
|
||||||
|
assert!(
|
||||||
|
Path::new(&*input).exists() || Url::parse(&input).is_ok(),
|
||||||
|
"{input} is not a valid repository"
|
||||||
|
);
|
||||||
|
Repository { inner: input }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Implementation {
|
impl Implementation {
|
||||||
fn dockerfile(&self) -> &'static str {
|
fn dockerfile(&self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Implementation::Unbound => include_str!("docker/unbound.Dockerfile"),
|
Implementation::Unbound => include_str!("docker/unbound.Dockerfile"),
|
||||||
Implementation::Hickory => include_str!("docker/hickory.Dockerfile"),
|
Implementation::Hickory { .. } => include_str!("docker/hickory.Dockerfile"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +71,8 @@ impl Implementation {
|
|||||||
static UNBOUND_ONCE: Once = Once::new();
|
static UNBOUND_ONCE: Once = Once::new();
|
||||||
&UNBOUND_ONCE
|
&UNBOUND_ONCE
|
||||||
}
|
}
|
||||||
Implementation::Hickory => {
|
|
||||||
|
Implementation::Hickory { .. } => {
|
||||||
static HICKORY_ONCE: Once = Once::new();
|
static HICKORY_ONCE: Once = Once::new();
|
||||||
&HICKORY_ONCE
|
&HICKORY_ONCE
|
||||||
}
|
}
|
||||||
@ -59,7 +90,7 @@ impl fmt::Display for Implementation {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let s = match self {
|
let s = match self {
|
||||||
Implementation::Unbound => "unbound",
|
Implementation::Unbound => "unbound",
|
||||||
Implementation::Hickory => "hickory",
|
Implementation::Hickory { .. } => "hickory",
|
||||||
};
|
};
|
||||||
f.write_str(s)
|
f.write_str(s)
|
||||||
}
|
}
|
||||||
@ -67,10 +98,18 @@ impl fmt::Display for Implementation {
|
|||||||
|
|
||||||
pub fn subject() -> Implementation {
|
pub fn subject() -> Implementation {
|
||||||
if let Ok(subject) = std::env::var("DNS_TEST_SUBJECT") {
|
if let Ok(subject) = std::env::var("DNS_TEST_SUBJECT") {
|
||||||
match subject.as_str() {
|
if subject == "unbound" {
|
||||||
"hickory" => Implementation::Hickory,
|
return Implementation::Unbound;
|
||||||
"unbound" => Implementation::Unbound,
|
}
|
||||||
_ => panic!("unknown implementation: {subject}"),
|
|
||||||
|
if subject.starts_with("hickory") {
|
||||||
|
if let Some(url) = subject.strip_prefix("hickory ") {
|
||||||
|
Implementation::Hickory(Repository(url.to_string()))
|
||||||
|
} else {
|
||||||
|
panic!("the syntax of DNS_TEST_SUBJECT is 'hickory $URL', e.g. 'hickory /tmp/hickory' or 'hickory https://github.com/owner/repo'")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
panic!("unknown implementation: {subject}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Implementation::default()
|
Implementation::default()
|
||||||
|
@ -43,7 +43,7 @@ impl<'a> NameServer<'a, Stopped> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
container: Container::run(Implementation::Unbound, network)?,
|
container: Container::run(&Implementation::Unbound, network)?,
|
||||||
zone_file,
|
zone_file,
|
||||||
state: Stopped,
|
state: Stopped,
|
||||||
})
|
})
|
||||||
|
@ -33,7 +33,7 @@ impl Resolver {
|
|||||||
"must configure at least one local root server"
|
"must configure at least one local root server"
|
||||||
);
|
);
|
||||||
|
|
||||||
let container = Container::run(implementation, network)?;
|
let container = Container::run(&implementation, network)?;
|
||||||
|
|
||||||
let mut hints = String::new();
|
let mut hints = String::new();
|
||||||
for root in roots {
|
for root in roots {
|
||||||
@ -51,7 +51,7 @@ impl Resolver {
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Implementation::Hickory => {
|
Implementation::Hickory { .. } => {
|
||||||
container.status_ok(&["mkdir", "-p", "/etc/hickory"])?;
|
container.status_ok(&["mkdir", "-p", "/etc/hickory"])?;
|
||||||
|
|
||||||
container.cp("/etc/hickory/root.hints", &hints)?;
|
container.cp("/etc/hickory/root.hints", &hints)?;
|
||||||
@ -66,7 +66,7 @@ impl Resolver {
|
|||||||
|
|
||||||
let command: &[_] = match implementation {
|
let command: &[_] = match implementation {
|
||||||
Implementation::Unbound => &["unbound", "-d"],
|
Implementation::Unbound => &["unbound", "-d"],
|
||||||
Implementation::Hickory => &["hickory-dns", "-d"],
|
Implementation::Hickory { .. } => &["hickory-dns", "-d"],
|
||||||
};
|
};
|
||||||
let child = container.spawn(command)?;
|
let child = container.spawn(command)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user