bump all crate versions

This commit is contained in:
Benjamin Fry 2017-07-30 07:00:52 -07:00
parent 743175bef5
commit 0f6a07711f
19 changed files with 1699 additions and 1214 deletions

View File

@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 0.11.0
## 0.11.0 (Unreleased)
### Added
@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- *breaking* all `&mut self` methods on `Name` deprecated as unsafe, Name is now immutable.
- *breaking* all `&mut self` methods on `Name` deprecated as unsafe, Name labels are now immutable.
- *breaking* All `ClientHandle` traits now take `&Handle` instead of `Handle` (@rushmorem)
- *warning* `Name` now tracks if it is a fully qualified domain name, slightly changes name parsing rules, allowing `www.example.com` without the trailing `.`, which means that FQDN names are not enforced.
@ -24,8 +24,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- *deprecated* `Name::append` wasn't clean, see `Name::append_name`
- *deprecated* `Name::add_label` exposed internal data structure, see `Name::append_label`
- *deprecated* `Name::label` unclear usage/name, see `Name::append_label`
- *deprecated* `Name::prepend_label` exposed internal data structure, unclear usage (no replacement)
- *deprecated* `Record::add_name` unclear usage (no replacement)
- *deprecated* `Name::prepend_label` exposed internal data structure, unclear usage *no replacement*
- *deprecated* `Record::add_name` unclear usage *no replacement*
## 0.10.5

235
Cargo.lock generated
View File

@ -1,6 +1,6 @@
[root]
name = "trust-dns-server"
version = "0.10.5"
version = "0.10.6"
dependencies = [
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -10,17 +10,17 @@ dependencies = [
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rusqlite 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-openssl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.10.6",
"trust-dns-native-tls 0.1.1",
"trust-dns 0.11.0",
"trust-dns-native-tls 0.1.2",
]
[[package]]
@ -67,7 +67,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -77,7 +77,7 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -86,22 +86,22 @@ name = "backtrace"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace-sys"
version = "0.1.11"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -160,13 +160,13 @@ name = "chrono"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clap"
version = "2.25.0"
version = "2.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -174,8 +174,8 @@ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -189,13 +189,21 @@ dependencies = [
"scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "conv"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core-foundation"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -203,7 +211,7 @@ name = "core-foundation-sys"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -215,6 +223,11 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "custom_derive"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "data-encoding"
version = "1.2.0"
@ -308,7 +321,7 @@ name = "iovec"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -396,7 +409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.26"
version = "0.2.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -405,7 +418,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -427,12 +440,29 @@ dependencies = [
"linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "magenta"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "magenta-sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memchr"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -440,7 +470,7 @@ name = "memchr"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -451,10 +481,10 @@ dependencies = [
"iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -465,7 +495,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -475,7 +505,7 @@ name = "native-tls"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -484,46 +514,46 @@ dependencies = [
[[package]]
name = "net2"
version = "0.2.29"
version = "0.2.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num"
version = "0.1.39"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-integer"
version = "0.1.34"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-iter"
version = "0.1.33"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
version = "0.1.39"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -531,28 +561,28 @@ name = "num_cpus"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl"
version = "0.9.14"
version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
version = "0.9.14"
version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -577,10 +607,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.15"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -599,14 +630,14 @@ dependencies = [
"coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.26"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -650,7 +681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -661,7 +692,7 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"libsqlite3-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
@ -735,7 +766,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -745,7 +776,7 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -768,7 +799,7 @@ name = "tempdir"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -786,13 +817,13 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "textwrap"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -805,7 +836,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -831,14 +862,14 @@ version = "0.1.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-core"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -867,14 +898,14 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-rustls"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -889,7 +920,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -903,23 +934,23 @@ dependencies = [
[[package]]
name = "trust-dns"
version = "0.10.6"
version = "0.11.0"
dependencies = [
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
"data-encoding 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-openssl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -933,20 +964,20 @@ dependencies = [
"data-encoding 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.10.6",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.11.0",
]
[[package]]
name = "trust-dns-native-tls"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.10.6",
"trust-dns 0.11.0",
]
[[package]]
@ -958,25 +989,25 @@ dependencies = [
"lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.10.6",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.11.0",
]
[[package]]
name = "trust-dns-rustls"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rustls 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-rustls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.10.6",
"tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-rustls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns 0.11.0",
]
[[package]]
name = "unicode-segmentation"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -1060,7 +1091,7 @@ dependencies = [
"checksum atty 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0fd4c0631f06448cc45a6bbb3b710ebb7ff8ccb96a0800c994afe23a70d5df2"
"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"
"checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f"
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff"
"checksum backtrace-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "afccc5772ba333abccdf60d55200fa3406f8c59dcf54d5f7998c9107d3799c7c"
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c"
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
@ -1070,11 +1101,13 @@ dependencies = [
"checksum bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24f16593f445422331a5eed46b72f7f171f910fead4f2ea8f17e727e9c5c14"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
"checksum clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "867a885995b4184be051b70a592d4d70e32d7a188db6e8dff626af286a962771"
"checksum clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2267a8fdd4dce6956ba6649e130f62fb279026e5e84b92aa939ac8f85ce3f9f0"
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd"
"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"
"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67"
"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d"
"checksum crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34988f7e069e0b2f3bfc064295161e489b2d4e04a2e4248fb94360cdf00b4ec"
"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"
"checksum data-encoding 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d867ddbf09de0b73e09ec798972fb7f870495a0893f6f736c1855448c5a56789"
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
"checksum diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0a515461b6c8c08419850ced27bc29e86166dcdcde8fbe76f8b1f0589bb49472"
@ -1097,31 +1130,33 @@ dependencies = [
"checksum lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c7743f235fc17f5f50f3b1e64a8690ee154f17f86bd68cbb78787c5b37907f7"
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"
"checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b"
"checksum libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "30885bcb161cf67054244d10d4a7f4835ffd58773bc72e07d35fecf472295503"
"checksum libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb7b49972ee23d8aa1026c365a5b440ba08e35075f18c459980c7395c221ec48"
"checksum libsqlite3-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b6de3eea39ba6ed0cddf04e1c7a78486e3f750441e0a0b15b6ea39d0dd8e1b8c"
"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527"
"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699"
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
"checksum mio 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9e965267d4d58496fc4f740e9861118367f13570cadf66316ed2c3f2f14d87c7"
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04b781c9134a954c84f0594b9ab3f5606abc516030388e8511887ef4c204a1e5"
"checksum net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)" = "bc01404e7568680f1259aa5729539f221cb1e6d047a0d9053cab4be8a73b5d67"
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887"
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37"
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e"
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6"
"checksum net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "94101fd932816f97eb9a5116f6c1a11511a1fed7db21c5ccd823b2dc11abf566"
"checksum num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "a311b77ebdc5dd4cf6449d81e4135d9f0e3b153839ac90e648a8ef538f923525"
"checksum num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "d1452e8b06e448a07f0e6ebb0bb1d92b8890eea63288c0b627331d53514d0fba"
"checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01"
"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0"
"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584"
"checksum openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)" = "11ba043cb65fc9af71a431b8a36ffe8686cd4751cdf70a473ec1d01066ac7e41"
"checksum openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)" = "236c718c2e2c2b58a546d86ffea5194400bb15dbe01ca85325ffd357b03cf66c"
"checksum openssl 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f776f1d8af832fd2c637ee182c801e8f7ea8895718a2be9914cca001f6e2c40a"
"checksum openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "ad95f8160d1c150c4f44d4c4959732e048ac046c37f597fe362f8bf57561ffb4"
"checksum ordermap 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c036a53e6bb62d7eee2edf7e087df56fd84c7bbae6a0bd93c2b9f54bddf62e03"
"checksum petgraph 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "14c6ae5ccb73b438781abc93d35615019b1ad6e24b44116377fb819cfd7587de"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf"
"checksum rayon 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a77c51c07654ddd93f6cb543c7a849863b03abc7e82591afda6dc8ad4ac3ac4a"
"checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493"
"checksum redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "9df6a71a1e67be2104410736b2389fb8e383c1d7e9e792d629ff13c02867147a"
"checksum redox_syscall 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "ddab7acd8e7bf3e49dfdf78ac1209b992329eb2f66e0bf672ab49c70a76d1d68"
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
@ -1144,18 +1179,18 @@ dependencies = [
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
"checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
"checksum textwrap 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f86300c3e7416ee233abd7cda890c492007a3980f941f79185c753a701257167"
"checksum textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f728584ea33b0ad19318e20557cb0a39097751dbb07171419673502f848c7af6"
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
"checksum tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6a20ba4738d283cac7495ca36e045c80c2a8df3e05dd0909b17a06646af5a7ed"
"checksum tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e85d419699ec4b71bfe35bbc25bb8771e52eff0471a7f75c853ad06e200b4f86"
"checksum tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c2c3ce9739f7387a0fa65b5421e81feae92e04d603f008898f4257790ce8c2db"
"checksum tokio-openssl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "364cd119c3aec80ebf74e7362e65c4659dbec9fb8fc6c6875c5b28e95bd2b168"
"checksum tokio-rustls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ceb17a9430966cb4061eea251209e7ae5acacaeb38e90b158f6f9c7f54bbc6"
"checksum tokio-rustls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7900933e39f7f47fbf5c4c6a19c3f334b4e89a61df9c3a709bbb4441bba5350"
"checksum tokio-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d88e411cac1c87e405e4090be004493c5d8072a370661033b1a64ea205ec2e13"
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
"checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3"
"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946"
"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"

View File

@ -1,6 +1,6 @@
[package]
name = "trust-dns"
version = "0.10.6"
version = "0.11.0"
authors = ["Benjamin Fry <benjaminfry@me.com>"]
# A short blurb about the package. This is not rendered in any format when

View File

@ -5,6 +5,8 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
#![allow(dead_code)]
extern crate data_encoding;
extern crate rand;
@ -49,7 +51,7 @@ impl Drop for NamedProcess {
self.thread_notice.store(true, Ordering::Relaxed);
println!("----> cleanup work dir: {}", self.working_dir);
fs::remove_dir_all(&self.working_dir);
fs::remove_dir_all(&self.working_dir).ok();
}
}

View File

@ -39,9 +39,9 @@ fn test_get() {
let client = SyncClient::new(conn);
let name = Name::parse("www.example.com.", None).unwrap();
let result = client
.query(&name, DNSClass::IN, RecordType::A)
.expect("query failed");
let result = client.query(&name, DNSClass::IN, RecordType::A).expect(
"query failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
assert_eq!(result.answers()[0].rr_type(), RecordType::A);
@ -55,32 +55,34 @@ fn test_get() {
}
fn create_sig0_ready_client<CC>(conn: CC) -> SyncClient
where CC: ClientConnection,
<CC as ClientConnection>::MessageStream: Stream<Item=Vec<u8>, Error=io::Error> + 'static
where
CC: ClientConnection,
<CC as ClientConnection>::MessageStream: Stream<Item = Vec<u8>, Error = io::Error> + 'static,
{
let server_path = env::var("TDNS_SERVER_SRC_ROOT").unwrap_or(".".to_owned());
let mut pem = File::open(format!("{}/../compatibility/tests/conf/Kupdate.example.com.+008+56935.pem",
server_path))
.expect("could not find pem file");
let mut pem = File::open(format!(
"{}/../compatibility/tests/conf/Kupdate.example.com.+008+56935.pem",
server_path
)).expect("could not find pem file");
let mut pem_buf = Vec::<u8>::new();
pem.read_to_end(&mut pem_buf)
.expect("failed to read pem");
pem.read_to_end(&mut pem_buf).expect("failed to read pem");
let rsa = Rsa::private_key_from_pem(&pem_buf).expect("something wrong with key from pem");
let key = KeyPair::from_rsa(rsa).unwrap();
let sig0key = KEY::new(Default::default(),
KeyUsage::Entity,
Default::default(),
Default::default(),
Algorithm::RSASHA256,
key.to_public_bytes().unwrap());
let sig0key = KEY::new(
Default::default(),
KeyUsage::Entity,
Default::default(),
Default::default(),
Algorithm::RSASHA256,
key.to_public_bytes().unwrap(),
);
let signer = Signer::sig0(sig0key,
key,
Name::with_labels(vec!["update".to_string(),
"example".to_string(),
"com".to_string()]));
let signer = Signer::sig0(
sig0key,
key,
Name::from_labels(vec!["update", "example", "com"]),
);
assert_eq!(signer.calculate_key_tag().unwrap(), 56935_u16);
@ -95,20 +97,20 @@ fn test_create() {
let conn = UdpClientConnection::new(socket).unwrap();
let client = create_sig0_ready_client(conn);
let origin = Name::with_labels(vec!["example".to_string(), "com".to_string()]);
let origin = Name::from_labels(vec!["example", "com"]);
// create a record
let mut record = Record::with(Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = client
.query(record.name(), record.dns_class(), record.rr_type())
@ -119,18 +121,18 @@ fn test_create() {
// trying to create again should error
// TODO: it would be cool to make this
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::YXRRSet);
// will fail if already set and not the same value.
let mut record = record.clone();
record.set_rdata(RData::A(Ipv4Addr::new(101, 11, 101, 11)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::YXRRSet);
}

View File

@ -1,6 +1,6 @@
[package]
name = "trust-dns-native-tls"
version = "0.1.1"
version = "0.1.2"
authors = ["Benjamin Fry <benjaminfry@me.com>"]
# A short blurb about the package. This is not rendered in any format when
@ -48,7 +48,7 @@ native-tls = "^0.1"
tokio-core = "^0.1"
tokio-tls = "^0.1"
# disables default features, i.e. openssl...
trust-dns = { version = "^0.10", path = "../client", default-features = false }
trust-dns = { version = "^0.11.0", path = "../client", default-features = false }
## Commented out until MTLS support is complete
# [target.'cfg(target_os = "linux")'.dependencies]

View File

@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 0.3.0
## 0.3.0 (Unreleased)
### Added

View File

@ -48,7 +48,7 @@ lalrpop-util = "^0.13.1"
log = "^0.3.5"
regex = "0.2.1"
tokio-core = "^0.1"
trust-dns = { version = "^0.10.6", path = "../client" }
trust-dns = { version = "^0.11.0", path = "../client" }
[dev-dependencies]
tokio-core = "^0.1"

View File

@ -1,6 +1,6 @@
[package]
name = "trust-dns-rustls"
version = "0.1.1"
version = "0.1.2"
authors = ["Benjamin Fry <benjaminfry@me.com>"]
# A short blurb about the package. This is not rendered in any format when
@ -50,7 +50,7 @@ rustls = "^0.9.0"
tokio-core = "^0.1"
tokio-rustls = "^0.2"
# disables default features, i.e. openssl...
trust-dns = { version = "^0.10", path = "../client", default-features = false }
trust-dns = { version = "^0.11.0", path = "../client", default-features = false }
[dev-dependencies]
openssl = { version = "^0.9.8", features = ["v102", "v110"] }

View File

@ -1,6 +1,6 @@
[package]
name = "trust-dns-server"
version = "0.10.5"
version = "0.10.6"
authors = ["Benjamin Fry <benjaminfry@me.com>"]
# A short blurb about the package. This is not rendered in any format when
@ -71,7 +71,7 @@ time = "^0.1"
tokio-core = "^0.1"
tokio-openssl = "^0.1"
toml = "^0.1"
trust-dns = { version = "^0.10", path = "../client" }
trust-dns = { version = "^0.11.0", path = "../client" }
[dev-dependencies]
native-tls = "^0.1"

View File

@ -48,7 +48,8 @@ impl Drop for NamedProcess {
}
fn wrap_process<R>(named: Child, io: R, started_str: &str) -> NamedProcess
where R: Read + Send + 'static
where
R: Read + Send + 'static,
{
let mut named_out = BufReader::new(io);
@ -57,7 +58,9 @@ fn wrap_process<R>(named: Child, io: R, started_str: &str) -> NamedProcess
let mut found = false;
for _ in 0..1000 {
output.clear();
named_out.read_line(&mut output).expect("could not read stdout");
named_out.read_line(&mut output).expect(
"could not read stdout",
);
// stdout().write(b"SRV: ").unwrap();
// stdout().write(output.as_bytes()).unwrap();
if output.ends_with(started_str) {
@ -78,7 +81,9 @@ fn wrap_process<R>(named: Child, io: R, started_str: &str) -> NamedProcess
let thread_notice = thread_notice_clone;
while !thread_notice.load(std::sync::atomic::Ordering::Relaxed) {
output.clear();
named_out.read_line(&mut output).expect("could not read stdout");
named_out.read_line(&mut output).expect(
"could not read stdout",
);
// stdout().write(b"SRV: ").unwrap();
// stdout().write(output.as_bytes()).unwrap();
}
@ -103,9 +108,14 @@ fn trust_dns_process() -> (NamedProcess, u16) {
let mut named = Command::new(&format!("{}/../target/debug/named", server_path))
.stdout(Stdio::piped())
.arg("-q")
.arg(&format!("--config={}/tests/named_test_configs/example.toml",
server_path))
.arg(&format!("--zonedir={}/tests/named_test_configs", server_path))
.arg(&format!(
"--config={}/tests/named_test_configs/example.toml",
server_path
))
.arg(&format!(
"--zonedir={}/tests/named_test_configs",
server_path
))
.arg(&format!("--port={}", test_port))
.spawn()
.expect("failed to start named");
@ -119,15 +129,15 @@ fn trust_dns_process() -> (NamedProcess, u16) {
/// Runs the bench tesk using the specified client
fn bench(b: &mut Bencher, io_loop: &mut Core, client: &mut BasicClientHandle) {
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
// validate the request
let response = io_loop.run(client.query(name.clone(), DNSClass::IN, RecordType::A));
assert!(!response.is_err(),
"request failed: {}",
response.unwrap_err());
assert!(
!response.is_err(),
"request failed: {}",
response.unwrap_err()
);
let response = response.unwrap();
assert_eq!(response.get_response_code(), ResponseCode::NoError);
@ -151,7 +161,11 @@ fn trust_dns_udp_bench(b: &mut Bencher) {
let (named, server_port) = trust_dns_process();
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port).to_socket_addrs().unwrap().next().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let (stream, sender) = UdpClientStream::new(addr, io_loop.handle());
let mut client = ClientFuture::new(stream, sender, io_loop.handle(), None);
@ -166,7 +180,11 @@ fn trust_dns_tcp_bench(b: &mut Bencher) {
let (named, server_port) = trust_dns_process();
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port).to_socket_addrs().unwrap().next().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let (stream, sender) = TcpClientStream::new(addr, io_loop.handle());
let mut client = ClientFuture::new(stream, sender, io_loop.handle(), None);
@ -190,7 +208,9 @@ fn bind_process() -> (NamedProcess, u16) {
// create the work directory
let working_dir = format!("{}/../target/bind_pwd", server_path);
if !Path::new(&working_dir).exists() {
DirBuilder::new().create(&working_dir).expect("failed to create dir");
DirBuilder::new().create(&working_dir).expect(
"failed to create dir",
);
}
let mut named = Command::new(bind_path)
@ -216,7 +236,11 @@ fn bind_udp_bench(b: &mut Bencher) {
let (named, server_port) = bind_process();
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port).to_socket_addrs().unwrap().next().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let (stream, sender) = UdpClientStream::new(addr, io_loop.handle());
let mut client = ClientFuture::new(stream, sender, io_loop.handle(), None);
@ -232,7 +256,11 @@ fn bind_tcp_bench(b: &mut Bencher) {
let (named, server_port) = bind_process();
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port).to_socket_addrs().unwrap().next().unwrap();
let addr: SocketAddr = ("127.0.0.1", server_port)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let (stream, sender) = TcpClientStream::new(addr, io_loop.handle());
let mut client = ClientFuture::new(stream, sender, io_loop.handle(), None);

File diff suppressed because it is too large Load Diff

View File

@ -50,11 +50,7 @@ fn test_query_udp_ipv4() {
use tokio_core::reactor::Core;
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let (stream, sender) = UdpClientStream::new(addr, &io_loop.handle());
let mut client = ClientFuture::new(stream, sender, &io_loop.handle(), None);
@ -90,11 +86,7 @@ fn test_query_tcp_ipv4() {
use tokio_core::reactor::Core;
let mut io_loop = Core::new().unwrap();
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let (stream, sender) = TcpClientStream::new(addr, &io_loop.handle());
let mut client = ClientFuture::new(stream, sender, &io_loop.handle(), None);
@ -125,36 +117,38 @@ fn test_query_tcp_ipv6() {
#[cfg(test)]
fn test_query(client: &mut BasicClientHandle) -> Box<Future<Item = (), Error = ()>> {
let name = domain::Name::with_labels(vec!["WWW".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["WWW", "example", "com"]);
Box::new(client
.query(name.clone(), DNSClass::IN, RecordType::A)
.map(move |response| {
println!("response records: {:?}", response);
assert_eq!(response
.queries()
.first()
.expect("expected query")
.name()
.cmp_with_case(&name, false),
Ordering::Equal);
Box::new(
client
.query(name.clone(), DNSClass::IN, RecordType::A)
.map(move |response| {
println!("response records: {:?}", response);
assert_eq!(
response
.queries()
.first()
.expect("expected query")
.name()
.cmp_with_case(&name, false),
Ordering::Equal
);
let record = &response.answers()[0];
assert_eq!(record.name(), &name);
assert_eq!(record.rr_type(), RecordType::A);
assert_eq!(record.dns_class(), DNSClass::IN);
let record = &response.answers()[0];
assert_eq!(record.name(), &name);
assert_eq!(record.rr_type(), RecordType::A);
assert_eq!(record.dns_class(), DNSClass::IN);
if let &RData::A(ref address) = record.rdata() {
assert_eq!(address, &Ipv4Addr::new(93, 184, 216, 34))
} else {
assert!(false);
}
})
.map_err(|e| {
assert!(false, "query failed: {}", e);
}))
if let &RData::A(ref address) = record.rdata() {
assert_eq!(address, &Ipv4Addr::new(93, 184, 216, 34))
} else {
assert!(false);
}
})
.map_err(|e| {
assert!(false, "query failed: {}", e);
}),
)
}
#[test]
@ -167,17 +161,21 @@ fn test_notify() {
let (stream, sender) = TestClientStream::new(catalog);
let mut client = ClientFuture::new(stream, sender, &io_loop.handle(), None);
let name = domain::Name::with_labels(vec!["ping".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["ping", "example", "com"]);
let message =
io_loop.run(client.notify(name.clone(), DNSClass::IN, RecordType::A, None::<RecordSet>));
let message = io_loop.run(client.notify(
name.clone(),
DNSClass::IN,
RecordType::A,
None::<RecordSet>,
));
assert!(message.is_ok());
let message = message.unwrap();
assert_eq!(message.response_code(),
ResponseCode::NotImp,
"the catalog must support Notify now, update this");
assert_eq!(
message.response_code(),
ResponseCode::NotImp,
"the catalog must support Notify now, update this"
);
}
// update tests
@ -189,9 +187,7 @@ fn create_sig0_ready_client(io_loop: &Core) -> (BasicClientHandle, domain::Name)
authority.set_allow_update(true);
let origin = authority.origin().clone();
let trusted_name = domain::Name::with_labels(vec!["trusted".to_string(),
"example".to_string(),
"com".to_string()]);
let trusted_name = domain::Name::from_labels(vec!["trusted", "example", "com"]);
let rsa = Rsa::generate(512).unwrap();
let key = KeyPair::from_rsa(rsa).unwrap();
@ -200,9 +196,11 @@ fn create_sig0_ready_client(io_loop: &Core) -> (BasicClientHandle, domain::Name)
let signer = Signer::sig0(sig0_key.clone(), key, trusted_name.clone());
// insert the KEY for the trusted.example.com
let mut auth_key = Record::with(trusted_name,
RecordType::KEY,
Duration::minutes(5).num_seconds() as u32);
let mut auth_key = Record::with(
trusted_name,
RecordType::KEY,
Duration::minutes(5).num_seconds() as u32,
);
auth_key.set_rdata(RData::KEY(sig0_key));
authority.upsert(auth_key, 0);
@ -222,11 +220,11 @@ fn test_create() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// create a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let record = record;
@ -236,7 +234,11 @@ fn test_create() {
.expect("create failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -265,11 +267,11 @@ fn test_create_multi() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// create a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let record = record;
@ -286,7 +288,11 @@ fn test_create_multi() {
.expect("create failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -296,9 +302,9 @@ fn test_create_multi() {
// trying to create again should error
// TODO: it would be cool to make this
let result = io_loop
.run(client.create(rrset, origin.clone()))
.expect("create failed");
let result = io_loop.run(client.create(rrset, origin.clone())).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::YXRRSet);
// will fail if already set and not the same value.
@ -317,11 +323,11 @@ fn test_append() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let record = record;
@ -339,7 +345,11 @@ fn test_append() {
// verify record contents
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -356,7 +366,11 @@ fn test_append() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -371,7 +385,11 @@ fn test_append() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -383,11 +401,11 @@ fn test_append_multi() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
@ -404,7 +422,11 @@ fn test_append_multi() {
// verify record contents
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -426,7 +448,11 @@ fn test_append_multi() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 3);
@ -443,7 +469,11 @@ fn test_append_multi() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 3);
@ -459,11 +489,11 @@ fn test_compare_and_swap() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// create a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let record = record;
@ -478,12 +508,20 @@ fn test_compare_and_swap() {
let new = new;
let result = io_loop
.run(client.compare_and_swap(current.clone(), new.clone(), origin.clone()))
.run(client.compare_and_swap(
current.clone(),
new.clone(),
origin.clone(),
))
.expect("compare_and_swap failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(new.name().clone(), new.dns_class(), new.rr_type()))
.run(client.query(
new.name().clone(),
new.dns_class(),
new.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -496,12 +534,20 @@ fn test_compare_and_swap() {
let not = not;
let result = io_loop
.run(client.compare_and_swap(current, not.clone(), origin.clone()))
.run(client.compare_and_swap(
current,
not.clone(),
origin.clone(),
))
.expect("compare_and_swap failed");
assert_eq!(result.response_code(), ResponseCode::NXRRSet);
let result = io_loop
.run(client.query(new.name().clone(), new.dns_class(), new.rr_type()))
.run(client.query(
new.name().clone(),
new.dns_class(),
new.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -519,11 +565,11 @@ fn test_compare_and_swap_multi() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// create a record
let mut current = RecordSet::with_ttl(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut current = RecordSet::with_ttl(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
let current1 = current
.new_record(RData::A(Ipv4Addr::new(100, 10, 100, 10)))
@ -546,12 +592,20 @@ fn test_compare_and_swap_multi() {
let new = new;
let result = io_loop
.run(client.compare_and_swap(current.clone(), new.clone(), origin.clone()))
.run(client.compare_and_swap(
current.clone(),
new.clone(),
origin.clone(),
))
.expect("compare_and_swap failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(new.name().clone(), new.dns_class(), new.record_type()))
.run(client.query(
new.name().clone(),
new.dns_class(),
new.record_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -566,12 +620,20 @@ fn test_compare_and_swap_multi() {
let not = not;
let result = io_loop
.run(client.compare_and_swap(current, not.clone(), origin.clone()))
.run(client.compare_and_swap(
current,
not.clone(),
origin.clone(),
))
.expect("compare_and_swap failed");
assert_eq!(result.response_code(), ResponseCode::NXRRSet);
let result = io_loop
.run(client.query(new.name().clone(), new.dns_class(), new.record_type()))
.run(client.query(
new.name().clone(),
new.dns_class(),
new.record_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -585,11 +647,11 @@ fn test_delete_by_rdata() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut record1 = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record1 = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record1.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
@ -618,9 +680,11 @@ fn test_delete_by_rdata() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record1.name().clone(),
record1.dns_class(),
record1.rr_type()))
.run(client.query(
record1.name().clone(),
record1.dns_class(),
record1.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
@ -633,11 +697,11 @@ fn test_delete_by_rdata_multi() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut rrset = RecordSet::with_ttl(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut rrset = RecordSet::with_ttl(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
let record1 = rrset
.new_record(RData::A(Ipv4Addr::new(100, 10, 100, 10)))
@ -666,11 +730,11 @@ fn test_delete_by_rdata_multi() {
assert_eq!(result.response_code(), ResponseCode::NoError);
// append a record
let mut rrset = RecordSet::with_ttl(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut rrset = RecordSet::with_ttl(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
let record1 = rrset.new_record(record1.rdata().clone()).clone();
let record3 = rrset.new_record(record3.rdata().clone()).clone();
@ -688,9 +752,11 @@ fn test_delete_by_rdata_multi() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record1.name().clone(),
record1.dns_class(),
record1.rr_type()))
.run(client.query(
record1.name().clone(),
record1.dns_class(),
record1.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
@ -706,11 +772,11 @@ fn test_delete_rrset() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
@ -739,7 +805,11 @@ fn test_delete_rrset() {
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), record.rr_type()))
.run(client.query(
record.name().clone(),
record.dns_class(),
record.rr_type(),
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NXDomain);
assert_eq!(result.answers().len(), 0);
@ -751,16 +821,20 @@ fn test_delete_all() {
let (mut client, origin) = create_sig0_ready_client(&io_loop);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
let result = io_loop
.run(client.delete_all(record.name().clone(), origin.clone(), DNSClass::IN))
.run(client.delete_all(
record.name().clone(),
origin.clone(),
DNSClass::IN,
))
.expect("delete failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
@ -780,27 +854,37 @@ fn test_delete_all() {
// verify record contents
let result = io_loop
.run(client.delete_all(record.name().clone(), origin.clone(), DNSClass::IN))
.run(client.delete_all(
record.name().clone(),
origin.clone(),
DNSClass::IN,
))
.expect("delete failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), RecordType::A))
.run(client.query(
record.name().clone(),
record.dns_class(),
RecordType::A,
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NXDomain);
assert_eq!(result.answers().len(), 0);
let result = io_loop
.run(client.query(record.name().clone(), record.dns_class(), RecordType::AAAA))
.run(client.query(
record.name().clone(),
record.dns_class(),
RecordType::AAAA,
))
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NXDomain);
assert_eq!(result.answers().len(), 0);
}
fn test_timeout_query(mut client: BasicClientHandle, mut io_loop: Core) {
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
let err = io_loop
.run(client.query(name.clone(), DNSClass::IN, RecordType::A))
@ -828,11 +912,13 @@ fn test_timeout_query(mut client: BasicClientHandle, mut io_loop: Core) {
fn test_timeout_query_nonet() {
let io_loop = Core::new().unwrap();
let (stream, sender) = NeverReturnsClientStream::new();
let client = ClientFuture::with_timeout(stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None);
let client = ClientFuture::with_timeout(
stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None,
);
test_timeout_query(client, io_loop);
}
@ -847,11 +933,13 @@ fn test_timeout_query_udp() {
.unwrap();
let (stream, sender) = UdpClientStream::new(addr, &io_loop.handle());
let client = ClientFuture::with_timeout(stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None);
let client = ClientFuture::with_timeout(
stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None,
);
test_timeout_query(client, io_loop);
}
@ -867,10 +955,12 @@ fn test_timeout_query_tcp() {
let (stream, sender) =
TcpClientStream::with_timeout(addr, &io_loop.handle(), std::time::Duration::from_millis(1));
let client = ClientFuture::with_timeout(stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None);
let client = ClientFuture::with_timeout(
stream,
sender,
&io_loop.handle(),
std::time::Duration::from_millis(1),
None,
);
test_timeout_query(client, io_loop);
}

View File

@ -43,11 +43,9 @@ impl TestClientConnection {
impl ClientConnection for TestClientConnection {
type MessageStream = TestClientStream;
fn unwrap
(self)
-> (Core,
Box<Future<Item = Self::MessageStream, Error = io::Error>>,
Box<ClientStreamHandle>) {
fn unwrap(
self,
) -> (Core, Box<Future<Item = Self::MessageStream, Error = io::Error>>, Box<ClientStreamHandle>) {
let io_loop = Core::new().unwrap();
let (stream, handle) = TestClientStream::new(self.catalog);
(io_loop, stream, handle)
@ -70,11 +68,7 @@ fn test_query_nonet() {
#[ignore]
#[allow(deprecated)]
fn test_query_udp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
let client = SyncClient::new(conn);
@ -85,11 +79,7 @@ fn test_query_udp() {
#[ignore]
#[allow(deprecated)]
fn test_query_tcp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
let client = SyncClient::new(conn);
@ -99,9 +89,7 @@ fn test_query_tcp() {
#[allow(deprecated)]
fn test_query(client: SyncClient) {
use std::cmp::Ordering;
let name = domain::Name::with_labels(vec!["WWW".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["WWW", "example", "com"]);
let response = client.query(&name, DNSClass::IN, RecordType::A);
assert!(response.is_ok(), "query failed: {}", response.unwrap_err());
@ -109,13 +97,15 @@ fn test_query(client: SyncClient) {
let response = response.unwrap();
println!("response records: {:?}", response);
assert_eq!(response
.queries()
.first()
.expect("expected query")
.name()
.cmp_with_case(&name, false),
Ordering::Equal);
assert_eq!(
response
.queries()
.first()
.expect("expected query")
.name()
.cmp_with_case(&name, false),
Ordering::Equal
);
let record = &response.answers()[0];
assert_eq!(record.name(), &name);
@ -161,11 +151,7 @@ fn test_secure_query_example_nonet() {
#[ignore]
#[allow(deprecated)]
fn test_secure_query_example_udp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
let client = SecureSyncClient::new(conn).build();
@ -176,11 +162,7 @@ fn test_secure_query_example_udp() {
#[ignore]
#[allow(deprecated)]
fn test_secure_query_example_tcp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
let client = SecureSyncClient::new(conn).build();
@ -189,15 +171,15 @@ fn test_secure_query_example_tcp() {
#[allow(deprecated)]
fn test_secure_query_example(client: SecureSyncClient) {
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
let response = client.secure_query(&name, DNSClass::IN, RecordType::A);
assert!(response.is_ok(),
"query for {} failed: {}",
name,
response.unwrap_err());
assert!(
response.is_ok(),
"query for {} failed: {}",
name,
response.unwrap_err()
);
let response = response.unwrap();
@ -217,9 +199,7 @@ fn test_secure_query_example(client: SecureSyncClient) {
}
fn test_timeout_query(client: SyncClient) {
let name = domain::Name::with_labels(vec!["WWW".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["WWW", "example", "com"]);
let response = client.query(&name, DNSClass::IN, RecordType::A);
assert!(response.is_err());
@ -260,9 +240,9 @@ fn test_timeout_query_tcp() {
.unwrap();
// TODO: need to add timeout length to SyncClient
let client = SyncClient::new(TcpClientConnection::with_timeout(addr,
time::Duration::from_millis(1))
.unwrap());
let client = SyncClient::new(
TcpClientConnection::with_timeout(addr, time::Duration::from_millis(1)).unwrap(),
);
test_timeout_query(client);
}
@ -270,36 +250,42 @@ fn test_timeout_query_tcp() {
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_udp() {
let c = SecureSyncClient::new(UdpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap())
.build();
c.secure_query(&domain::Name::parse("rollernet.us.", None).unwrap(),
DNSClass::IN,
RecordType::DS)
.unwrap();
let c = SecureSyncClient::new(
UdpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap(),
).build();
c.secure_query(
&domain::Name::parse("rollernet.us.", None).unwrap(),
DNSClass::IN,
RecordType::DS,
).unwrap();
}
#[test]
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_tcp() {
let c = SecureSyncClient::new(TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap())
.build();
c.secure_query(&domain::Name::parse("rollernet.us.", None).unwrap(),
DNSClass::IN,
RecordType::DS)
.unwrap();
let c = SecureSyncClient::new(
TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap(),
).build();
c.secure_query(
&domain::Name::parse("rollernet.us.", None).unwrap(),
DNSClass::IN,
RecordType::DS,
).unwrap();
}
#[test]
#[ignore]
#[allow(deprecated)]
fn test_dnssec_rollernet_td_tcp_mixed_case() {
let c = SecureSyncClient::new(TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap())
.build();
c.secure_query(&domain::Name::parse("RollErnet.Us.", None).unwrap(),
DNSClass::IN,
RecordType::DS)
.unwrap();
let c = SecureSyncClient::new(
TcpClientConnection::new("8.8.8.8:53".parse().unwrap()).unwrap(),
).build();
c.secure_query(
&domain::Name::parse("RollErnet.Us.", None).unwrap(),
DNSClass::IN,
RecordType::DS,
).unwrap();
}
#[test]
@ -333,11 +319,7 @@ fn test_nsec_query_example_nonet() {
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_example_udp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = UdpClientConnection::new(addr).unwrap();
let client = SecureSyncClient::new(conn).build();
test_nsec_query_example::<UdpClientConnection>(client);
@ -347,11 +329,7 @@ fn test_nsec_query_example_udp() {
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_example_tcp() {
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
let client = SecureSyncClient::new(conn).build();
test_nsec_query_example::<TcpClientConnection>(client);
@ -359,9 +337,7 @@ fn test_nsec_query_example_tcp() {
#[allow(deprecated)]
fn test_nsec_query_example<C: ClientConnection>(client: SecureSyncClient) {
let name = domain::Name::with_labels(vec!["none".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["none", "example", "com"]);
let response = client.secure_query(&name, DNSClass::IN, RecordType::A);
assert!(response.is_ok(), "query failed: {}", response.unwrap_err());
@ -375,15 +351,9 @@ fn test_nsec_query_example<C: ClientConnection>(client: SecureSyncClient) {
#[ignore]
#[allow(deprecated)]
fn test_nsec_query_type() {
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let conn = TcpClientConnection::new(addr).unwrap();
let client = SecureSyncClient::new(conn).build();
@ -404,7 +374,7 @@ fn test_nsec_query_type() {
// fn test_nsec3_sdsmt() {
// let addr: SocketAddr = ("75.75.75.75",53).to_socket_addrs().unwrap().next().unwrap();
// let conn = TcpClientConnection::new(addr).unwrap();
// let name = domain::Name::with_labels(vec!["none".to_string(), "sdsmt".to_string(), "edu".to_string()]);
// let name = domain::Name::from_labels(vec!["none", "sdsmt", "edu"]);
// let client = Client::new(conn);
//
// let response = client.secure_query(&name, DNSClass::IN, RecordType::NS);
@ -421,7 +391,7 @@ fn test_nsec_query_type() {
// fn test_nsec3_sdsmt_type() {
// let addr: SocketAddr = ("75.75.75.75",53).to_socket_addrs().unwrap().next().unwrap();
// let conn = TcpClientConnection::new(addr).unwrap();
// let name = domain::Name::with_labels(vec!["www".to_string(), "sdsmt".to_string(), "edu".to_string()]);
// let name = domain::Name::from_labels(vec!["www", "sdsmt", "edu"]);
// let client = Client::new(conn);
//
// let response = client.secure_query(&name, DNSClass::IN, RecordType::NS);
@ -440,28 +410,29 @@ fn create_sig0_ready_client(mut catalog: Catalog) -> (SyncClient, domain::Name)
let rsa = Rsa::generate(512).unwrap();
let key = KeyPair::from_rsa(rsa).unwrap();
let signer = Signer::new(Algorithm::RSASHA256,
key,
domain::Name::with_labels(vec!["trusted".to_string(),
"example".to_string(),
"com".to_string()]),
Duration::max_value(),
true,
true);
let signer = Signer::new(
Algorithm::RSASHA256,
key,
domain::Name::from_labels(vec!["trusted", "example", "com"]),
Duration::max_value(),
true,
true,
);
// insert the KEY for the trusted.example.com
let mut auth_key = Record::with(domain::Name::with_labels(vec!["trusted".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::KEY,
Duration::minutes(5).num_seconds() as u32);
auth_key
.set_rdata(RData::KEY(KEY::new(Default::default(),
Default::default(),
Default::default(),
Default::default(),
signer.algorithm(),
signer.key().to_public_bytes().expect("to_vec failed"))));
let mut auth_key = Record::with(
domain::Name::from_labels(vec!["trusted", "example", "com"]),
RecordType::KEY,
Duration::minutes(5).num_seconds() as u32,
);
auth_key.set_rdata(RData::KEY(KEY::new(
Default::default(),
Default::default(),
Default::default(),
Default::default(),
signer.algorithm(),
signer.key().to_public_bytes().expect("to_vec failed"),
)));
authority.upsert(auth_key, 0);
catalog.upsert(authority.origin().clone(), authority);
@ -476,17 +447,17 @@ fn test_create() {
let (client, origin) = create_sig0_ready_client(catalog);
// create a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = client
.query(record.name(), record.dns_class(), record.rr_type())
@ -497,18 +468,18 @@ fn test_create() {
// trying to create again should error
// TODO: it would be cool to make this
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::YXRRSet);
// will fail if already set and not the same value.
let mut record = record.clone();
record.set_rdata(RData::A(Ipv4Addr::new(101, 11, 101, 11)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::YXRRSet);
}
@ -519,17 +490,17 @@ fn test_append() {
let (client, origin) = create_sig0_ready_client(catalog);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
let result = client
.append(record.clone(), origin.clone(), true)
.expect("append failed");
let result = client.append(record.clone(), origin.clone(), true).expect(
"append failed",
);
assert_eq!(result.response_code(), ResponseCode::NXRRSet);
// next append to a non-existent RRset
@ -550,9 +521,9 @@ fn test_append() {
let mut record = record.clone();
record.set_rdata(RData::A(Ipv4Addr::new(101, 11, 101, 11)));
let result = client
.append(record.clone(), origin.clone(), true)
.expect("create failed");
let result = client.append(record.clone(), origin.clone(), true).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = client
@ -561,27 +532,25 @@ fn test_append() {
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 2);
assert!(result
.answers()
.iter()
.any(|rr| if let &RData::A(ref ip) = rr.rdata() {
*ip == Ipv4Addr::new(100, 10, 100, 10)
} else {
false
}));
assert!(result
.answers()
.iter()
.any(|rr| if let &RData::A(ref ip) = rr.rdata() {
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
assert!(result.answers().iter().any(|rr| if let &RData::A(ref ip) =
rr.rdata()
{
*ip == Ipv4Addr::new(100, 10, 100, 10)
} else {
false
}));
assert!(result.answers().iter().any(|rr| if let &RData::A(ref ip) =
rr.rdata()
{
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
// show that appending the same thing again is ok, but doesn't add any records
let result = client
.append(record.clone(), origin.clone(), true)
.expect("create failed");
let result = client.append(record.clone(), origin.clone(), true).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = client
@ -597,16 +566,16 @@ fn test_compare_and_swap() {
let (client, origin) = create_sig0_ready_client(catalog);
// create a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let current = record;
@ -623,14 +592,13 @@ fn test_compare_and_swap() {
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
assert!(result
.answers()
.iter()
.any(|rr| if let &RData::A(ref ip) = rr.rdata() {
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
assert!(result.answers().iter().any(|rr| if let &RData::A(ref ip) =
rr.rdata()
{
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
// check the it fails if tried again.
let mut new = new;
@ -646,14 +614,13 @@ fn test_compare_and_swap() {
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
assert!(result
.answers()
.iter()
.any(|rr| if let &RData::A(ref ip) = rr.rdata() {
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
assert!(result.answers().iter().any(|rr| if let &RData::A(ref ip) =
rr.rdata()
{
*ip == Ipv4Addr::new(101, 11, 101, 11)
} else {
false
}));
}
#[test]
@ -662,11 +629,11 @@ fn test_delete_by_rdata() {
let (client, origin) = create_sig0_ready_client(catalog);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
@ -676,16 +643,16 @@ fn test_delete_by_rdata() {
assert_eq!(result.response_code(), ResponseCode::NoError);
// next create to a non-existent RRset
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let mut record = record.clone();
record.set_rdata(RData::A(Ipv4Addr::new(101, 11, 101, 11)));
let result = client
.append(record.clone(), origin.clone(), true)
.expect("create failed");
let result = client.append(record.clone(), origin.clone(), true).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
// verify record contents
@ -699,14 +666,13 @@ fn test_delete_by_rdata() {
.expect("query failed");
assert_eq!(result.response_code(), ResponseCode::NoError);
assert_eq!(result.answers().len(), 1);
assert!(result
.answers()
.iter()
.any(|rr| if let &RData::A(ref ip) = rr.rdata() {
*ip == Ipv4Addr::new(100, 10, 100, 10)
} else {
false
}));
assert!(result.answers().iter().any(|rr| if let &RData::A(ref ip) =
rr.rdata()
{
*ip == Ipv4Addr::new(100, 10, 100, 10)
} else {
false
}));
}
#[test]
@ -715,36 +681,36 @@ fn test_delete_rrset() {
let (client, origin) = create_sig0_ready_client(catalog);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
let result = client
.delete_rrset(record.clone(), origin.clone())
.expect("delete failed");
let result = client.delete_rrset(record.clone(), origin.clone()).expect(
"delete failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
// next create to a non-existent RRset
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let mut record = record.clone();
record.set_rdata(RData::A(Ipv4Addr::new(101, 11, 101, 11)));
let result = client
.append(record.clone(), origin.clone(), true)
.expect("create failed");
let result = client.append(record.clone(), origin.clone(), true).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
// verify record contents
let result = client
.delete_rrset(record.clone(), origin.clone())
.expect("delete failed");
let result = client.delete_rrset(record.clone(), origin.clone()).expect(
"delete failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let result = client
@ -760,11 +726,11 @@ fn test_delete_all() {
let (client, origin) = create_sig0_ready_client(catalog);
// append a record
let mut record = Record::with(domain::Name::with_labels(vec!["new".to_string(),
"example".to_string(),
"com".to_string()]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32);
let mut record = Record::with(
domain::Name::from_labels(vec!["new", "example", "com"]),
RecordType::A,
Duration::minutes(5).num_seconds() as u32,
);
record.set_rdata(RData::A(Ipv4Addr::new(100, 10, 100, 10)));
// first check the must_exist option
@ -774,17 +740,17 @@ fn test_delete_all() {
assert_eq!(result.response_code(), ResponseCode::NoError);
// next create to a non-existent RRset
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
let mut record = record.clone();
record.set_rr_type(RecordType::AAAA);
record.set_rdata(RData::AAAA(Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8)));
let result = client
.create(record.clone(), origin.clone())
.expect("create failed");
let result = client.create(record.clone(), origin.clone()).expect(
"create failed",
);
assert_eq!(result.response_code(), ResponseCode::NoError);
// verify record contents

View File

@ -17,7 +17,8 @@ use trust_dns::rr::*;
/// Spins up a Server and handles shutting it down after running the test
#[allow(dead_code)]
pub fn named_test_harness<F, R>(toml: &str, test: F)
where F: FnOnce(u16, u16) -> R + UnwindSafe
where
F: FnOnce(u16, u16) -> R + UnwindSafe,
{
// find a random port to listen on
let (test_port, test_tls_port) = {
@ -80,9 +81,9 @@ pub fn named_test_harness<F, R>(toml: &str, test: F)
let mut found = false;
for _ in 0..1000 {
output.clear();
named_out
.read_line(&mut output)
.expect("could not read stdout");
named_out.read_line(&mut output).expect(
"could not read stdout",
);
if !output.is_empty() {
stdout().write(b"SRV: ").unwrap();
stdout().write(output.as_bytes()).unwrap();
@ -104,9 +105,9 @@ pub fn named_test_harness<F, R>(toml: &str, test: F)
let succeeded = succeeded_clone;
while !succeeded.load(atomic::Ordering::Relaxed) {
output.clear();
named_out
.read_line(&mut output)
.expect("could not read stdout");
named_out.read_line(&mut output).expect(
"could not read stdout",
);
if !output.is_empty() {
stdout().write(b"SRV: ").unwrap();
stdout().write(output.as_bytes()).unwrap();
@ -130,9 +131,7 @@ pub fn named_test_harness<F, R>(toml: &str, test: F)
// i.e. more complex checks live with the clients and authorities to validate deeper funcionality
#[allow(dead_code)]
pub fn query(io_loop: &mut Core, client: &mut BasicClientHandle) -> bool {
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
println!("sending request");
let response = io_loop.run(client.query(name.clone(), DNSClass::IN, RecordType::A));

View File

@ -14,8 +14,10 @@ use trust_dns_server::authority::persistence::CURRENT_VERSION;
#[test]
fn test_new_journal() {
let conn = Connection::open_in_memory().expect("could not create in memory DB");
assert_eq!(Journal::new(conn).expect("new Journal").schema_version(),
-1);
assert_eq!(
Journal::new(conn).expect("new Journal").schema_version(),
-1
);
}
#[test]
@ -24,12 +26,14 @@ fn test_init_journal() {
let mut journal = Journal::new(conn).unwrap();
let version = journal.schema_up().unwrap();
assert_eq!(version, CURRENT_VERSION);
assert_eq!(Journal::select_schema_version(journal.conn()).unwrap(),
CURRENT_VERSION);
assert_eq!(
Journal::select_schema_version(journal.conn()).unwrap(),
CURRENT_VERSION
);
}
fn create_test_journal() -> (Record, Journal) {
let www = Name::with_labels(vec!["www".to_string(), "example".to_string(), "com".to_string()]);
let www = Name::from_labels(vec!["www", "example", "com"]);
let mut record = Record::new();
record.set_name(www);
@ -56,19 +60,25 @@ fn test_insert_and_select_record() {
let (mut record, journal) = create_test_journal();
// select the record
let (row_id, journal_record) =
journal.select_record(0).expect("persistence error").expect("none");
let (row_id, journal_record) = journal
.select_record(0)
.expect("persistence error")
.expect("none");
record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.0.1").unwrap()));
assert_eq!(journal_record, record);
// test another
let (row_id, journal_record) =
journal.select_record(row_id + 1).expect("persistence error").expect("none");
let (row_id, journal_record) = journal
.select_record(row_id + 1)
.expect("persistence error")
.expect("none");
record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.1.1").unwrap()));
assert_eq!(journal_record, record);
// check that we get nothing for id over row_id
let option_none = journal.select_record(row_id + 1).expect("persistence error");
let option_none = journal.select_record(row_id + 1).expect(
"persistence error",
);
assert!(option_none.is_none());
}
@ -78,9 +88,13 @@ fn test_iterator() {
let mut iter = journal.iter();
assert_eq!(record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.0.1").unwrap())),
&iter.next().unwrap());
assert_eq!(record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.1.1").unwrap())),
&iter.next().unwrap());
assert_eq!(
record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.0.1").unwrap())),
&iter.next().unwrap()
);
assert_eq!(
record.set_rdata(RData::A(Ipv4Addr::from_str("127.0.1.1").unwrap())),
&iter.next().unwrap()
);
assert_eq!(None, iter.next());
}

View File

@ -42,11 +42,10 @@ fn test_secure_query_example_tcp() {
}
fn test_secure_query_example<H>(mut client: SecureClientHandle<H>, mut io_loop: Core)
where H: ClientHandle + 'static
where
H: ClientHandle + 'static,
{
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
let response = io_loop
.run(client.query(name.clone(), DNSClass::IN, RecordType::A))
.expect("query failed");
@ -85,11 +84,10 @@ fn test_nsec_query_example_tcp() {
}
fn test_nsec_query_example<H>(mut client: SecureClientHandle<H>, mut io_loop: Core)
where H: ClientHandle + 'static
where
H: ClientHandle + 'static,
{
let name = domain::Name::with_labels(vec!["none".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["none", "example", "com"]);
let response = io_loop
.run(client.query(name.clone(), DNSClass::IN, RecordType::A))
@ -116,11 +114,10 @@ fn test_nsec_query_type_tcp() {
}
fn test_nsec_query_type<H>(mut client: SecureClientHandle<H>, mut io_loop: Core)
where H: ClientHandle + 'static
where
H: ClientHandle + 'static,
{
let name = domain::Name::with_labels(vec!["www".to_string(),
"example".to_string(),
"com".to_string()]);
let name = domain::Name::from_labels(vec!["www", "example", "com"]);
let response = io_loop
.run(client.query(name.clone(), DNSClass::IN, RecordType::NS))
@ -149,7 +146,8 @@ fn test_dnssec_rollernet_td_tcp_mixed_case() {
}
fn dnssec_rollernet_td_test<H>(mut client: SecureClientHandle<H>, mut io_loop: Core)
where H: ClientHandle + 'static
where
H: ClientHandle + 'static,
{
let name = domain::Name::parse("rollernet.us.", None).unwrap();
@ -164,7 +162,8 @@ fn dnssec_rollernet_td_test<H>(mut client: SecureClientHandle<H>, mut io_loop: C
}
fn dnssec_rollernet_td_mixed_case_test<H>(mut client: SecureClientHandle<H>, mut io_loop: Core)
where H: ClientHandle + 'static
where
H: ClientHandle + 'static,
{
let name = domain::Name::parse("RollErnet.Us.", None).unwrap();
@ -179,8 +178,9 @@ fn dnssec_rollernet_td_mixed_case_test<H>(mut client: SecureClientHandle<H>, mut
}
fn with_nonet<F>(test: F)
where F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core)
where
F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core),
{
let succeeded = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
let succeeded_clone = succeeded.clone();
@ -229,8 +229,9 @@ fn with_nonet<F>(test: F)
}
fn with_udp<F>(test: F)
where F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core)
where
F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core),
{
let succeeded = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
let succeeded_clone = succeeded.clone();
@ -250,11 +251,7 @@ fn with_udp<F>(test: F)
.unwrap();
let io_loop = Core::new().unwrap();
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let (stream, sender) = UdpClientStream::new(addr, &io_loop.handle());
let client = ClientFuture::new(stream, sender, &io_loop.handle(), None);
let client = MemoizeClientHandle::new(client);
@ -266,8 +263,9 @@ fn with_udp<F>(test: F)
}
fn with_tcp<F>(test: F)
where F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core)
where
F: Fn(SecureClientHandle<MemoizeClientHandle<BasicClientHandle>>,
Core),
{
let succeeded = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
let succeeded_clone = succeeded.clone();
@ -287,11 +285,7 @@ fn with_tcp<F>(test: F)
.unwrap();
let io_loop = Core::new().unwrap();
let addr: SocketAddr = ("8.8.8.8", 53)
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let addr: SocketAddr = ("8.8.8.8", 53).to_socket_addrs().unwrap().next().unwrap();
let (stream, sender) = TcpClientStream::new(addr, &io_loop.handle());
let client = ClientFuture::new(stream, sender, &io_loop.handle(), None);
let client = MemoizeClientHandle::new(client);

View File

@ -128,9 +128,7 @@ fn test_server_www_tls() {
let subject_key_identifier = SubjectKeyIdentifier::new()
.build(&x509_build.x509v3_context(None, None))
.unwrap();
x509_build
.append_extension(subject_key_identifier)
.unwrap();
x509_build.append_extension(subject_key_identifier).unwrap();
let authority_key_identifier = AuthorityKeyIdentifier::new()
.keyid(true)
@ -165,14 +163,16 @@ fn test_server_www_tls() {
let server_thread = thread::Builder::new()
.name("test_server:tls:server".to_string())
.spawn(move || server_thread_tls(tcp_listener, server_continue2, pkcs12_der))
.spawn(move || {
server_thread_tls(tcp_listener, server_continue2, pkcs12_der)
})
.unwrap();
let client_thread = thread::Builder::new()
.name("test_server:tcp:client".to_string())
.spawn(move || {
client_thread_www(lazy_tls_client(ipaddr, subject_name.to_string(), cert_der))
})
client_thread_www(lazy_tls_client(ipaddr, subject_name.to_string(), cert_der))
})
.unwrap();
let client_result = client_thread.join();
@ -190,10 +190,11 @@ fn lazy_tcp_client(ipaddr: SocketAddr) -> TcpClientConnection {
TcpClientConnection::new(ipaddr).unwrap()
}
fn lazy_tls_client(ipaddr: SocketAddr,
subject_name: String,
cert_der: Vec<u8>)
-> TlsClientConnection {
fn lazy_tls_client(
ipaddr: SocketAddr,
subject_name: String,
cert_der: Vec<u8>,
) -> TlsClientConnection {
let mut builder = TlsClientConnection::builder();
let trust_chain = X509::from_der(&cert_der).unwrap();
@ -203,18 +204,21 @@ fn lazy_tls_client(ipaddr: SocketAddr,
}
fn client_thread_www<C: ClientConnection>(conn: C)
where C::MessageStream: Stream<Item = Vec<u8>, Error = io::Error> + 'static
where
C::MessageStream: Stream<Item = Vec<u8>, Error = io::Error> + 'static,
{
let name = Name::with_labels(vec!["www".to_string(), "example".to_string(), "com".to_string()]);
let name = Name::from_labels(vec!["www", "example", "com"]);
let client = SyncClient::new(conn);
let response = client
.query(&name, DNSClass::IN, RecordType::A)
.expect("error querying");
let response = client.query(&name, DNSClass::IN, RecordType::A).expect(
"error querying",
);
assert!(response.response_code() == ResponseCode::NoError,
"got an error: {:?}",
response.response_code());
assert!(
response.response_code() == ResponseCode::NoError,
"got an error: {:?}",
response.response_code()
);
let record = &response.answers()[0];
assert_eq!(record.name(), &name);
@ -232,11 +236,15 @@ fn client_thread_www<C: ClientConnection>(conn: C)
assert_eq!(ns.len(), 2);
assert_eq!(ns.first().unwrap().rr_type(), RecordType::NS);
assert_eq!(ns.first().unwrap().rdata(),
&RData::NS(Name::parse("a.iana-servers.net.", None).unwrap()));
assert_eq!(
ns.first().unwrap().rdata(),
&RData::NS(Name::parse("a.iana-servers.net.", None).unwrap())
);
assert_eq!(ns.last().unwrap().rr_type(), RecordType::NS);
assert_eq!(ns.last().unwrap().rdata(),
&RData::NS(Name::parse("b.iana-servers.net.", None).unwrap()));
assert_eq!(
ns.last().unwrap().rdata(),
&RData::NS(Name::parse("b.iana-servers.net.", None).unwrap())
);
}
fn new_catalog() -> Catalog {
@ -271,9 +279,11 @@ fn server_thread_tcp(tcp_listener: TcpListener, server_continue: Arc<AtomicBool>
}
}
fn server_thread_tls(tls_listener: TcpListener,
server_continue: Arc<AtomicBool>,
pkcs12_der: Vec<u8>) {
fn server_thread_tls(
tls_listener: TcpListener,
server_continue: Arc<AtomicBool>,
pkcs12_der: Vec<u8>,
) {
let catalog = new_catalog();
let mut server = ServerFuture::new(catalog).expect("new tcp server failed");
let pkcs12 = Pkcs12::from_der(&pkcs12_der)

View File

@ -12,7 +12,8 @@ use trust_dns_server::authority::*;
#[test]
fn test_string() {
let lexer = Lexer::new("@ IN SOA venera action\\.domains (
let lexer = Lexer::new(
"@ IN SOA venera action\\.domains (
\
20 ; SERIAL
7200 ; REFRESH
@ -50,9 +51,10 @@ _ldap._tcp.service SRV 1 2 3 short
short 70 A \
26.3.0.104
venera A 10.1.0.52
A 128.9.0.32");
A 128.9.0.32",
);
let records = Parser::new().parse(lexer, Some(Name::new().label("isi").label("edu")));
let records = Parser::new().parse(lexer, Some(Name::from_labels(vec!["isi", "edu"])));
if records.is_err() {
panic!("failed to parse: {:?}", records.err())
}
@ -65,16 +67,19 @@ venera A 10.1.0.52
// SOA
let soa_record = authority.soa().unwrap();
assert_eq!(RecordType::SOA, soa_record.rr_type());
assert_eq!(&Name::new().label("isi").label("edu"),
soa_record.name()); // i.e. the origin or domain
assert_eq!(&Name::from_labels(vec!["isi", "edu"]), soa_record.name()); // i.e. the origin or domain
assert_eq!(3600000, soa_record.ttl());
assert_eq!(DNSClass::IN, soa_record.dns_class());
if let RData::SOA(ref soa) = *soa_record.rdata() {
// this should all be lowercased
assert_eq!(&Name::new().label("venera").label("isi").label("edu"),
soa.mname());
assert_eq!(&Name::new().label("action.domains").label("isi").label("edu"),
soa.rname());
assert_eq!(
&Name::from_labels(vec!["venera", "isi", "edu"]),
soa.mname()
);
assert_eq!(
&Name::from_labels(vec!["action.domains", "isi", "edu"]),
soa.rname()
);
assert_eq!(20, soa.serial());
assert_eq!(7200, soa.refresh());
assert_eq!(600, soa.retry());
@ -85,23 +90,25 @@ venera A 10.1.0.52
}
// NS
let mut ns_records: Vec<&Record> =
authority.lookup(&Name::with_labels(vec!["isi".into(), "edu".into()]),
RecordType::NS,
false,
SupportedAlgorithms::new());
let mut compare = vec![// this is cool, zip up the expected results... works as long as the order is good.
Name::new().label("a").label("isi").label("edu"),
Name::new().label("venera").label("isi").label("edu"),
Name::new().label("vaxa").label("isi").label("edu")];
let mut ns_records: Vec<&Record> = authority.lookup(
&Name::from_labels(vec!["isi", "edu"]),
RecordType::NS,
false,
SupportedAlgorithms::new(),
);
let mut compare = vec![
// this is cool, zip up the expected results... works as long as the order is good.
Name::from_labels(vec!["a", "isi", "edu"]),
Name::from_labels(vec!["venera", "isi", "edu"]),
Name::from_labels(vec!["vaxa", "isi", "edu"]),
];
compare.sort();
ns_records.sort();
let compare = ns_records.iter().zip(compare);
for (record, ref name) in compare {
assert_eq!(&Name::with_labels(vec!["isi".into(), "edu".into()]),
record.name());
assert_eq!(&Name::from_labels(vec!["isi", "edu"]), record.name());
assert_eq!(60, record.ttl()); // TODO: should this be minimum or expire?
assert_eq!(DNSClass::IN, record.dns_class());
assert_eq!(RecordType::NS, record.rr_type());
@ -113,12 +120,16 @@ venera A 10.1.0.52
}
// MX
let mut mx_records: Vec<&Record> = authority.lookup(&Name::new().label("isi").label("edu"),
RecordType::MX,
false,
SupportedAlgorithms::new());
let mut compare = vec![(10, Name::new().label("venera").label("isi").label("edu")),
(20, Name::new().label("vaxa").label("isi").label("edu"))];
let mut mx_records: Vec<&Record> = authority.lookup(
&Name::from_labels(vec!["isi", "edu"]),
RecordType::MX,
false,
SupportedAlgorithms::new(),
);
let mut compare = vec![
(10, Name::from_labels(vec!["venera", "isi", "edu"])),
(20, Name::from_labels(vec!["vaxa", "isi", "edu"])),
];
compare.sort();
mx_records.sort();
@ -126,7 +137,7 @@ venera A 10.1.0.52
for (record, (num, ref name)) in compare {
assert_eq!(&Name::new().label("isi").label("edu"), record.name());
assert_eq!(&Name::from_labels(vec!["isi", "edu"]), record.name());
assert_eq!(60, record.ttl()); // TODO: should this be minimum or expire?
assert_eq!(DNSClass::IN, record.dns_class());
assert_eq!(RecordType::MX, record.rr_type());
@ -139,15 +150,17 @@ venera A 10.1.0.52
}
// A
let a_record: &Record = authority.lookup(&Name::new().label("a").label("isi").label("edu"),
RecordType::A,
false,
SupportedAlgorithms::new())
let a_record: &Record = authority
.lookup(
&Name::from_labels(vec!["a", "isi", "edu"]),
RecordType::A,
false,
SupportedAlgorithms::new(),
)
.first()
.cloned()
.unwrap();
assert_eq!(&Name::new().label("a").label("isi").label("edu"),
a_record.name());
assert_eq!(&Name::from_labels(vec!["a", "isi", "edu"]), a_record.name());
assert_eq!(60, a_record.ttl()); // TODO: should this be minimum or expire?
assert_eq!(DNSClass::IN, a_record.dns_class());
assert_eq!(RecordType::A, a_record.rr_type());
@ -158,34 +171,44 @@ venera A 10.1.0.52
}
// AAAA
let aaaa_record: &Record =
authority.lookup(&Name::new().label("aaaa").label("isi").label("edu"),
RecordType::AAAA,
false,
SupportedAlgorithms::new())
.first()
.cloned()
.unwrap();
assert_eq!(&Name::new().label("aaaa").label("isi").label("edu"),
aaaa_record.name());
let aaaa_record: &Record = authority
.lookup(
&Name::from_labels(vec!["aaaa", "isi", "edu"]),
RecordType::AAAA,
false,
SupportedAlgorithms::new(),
)
.first()
.cloned()
.unwrap();
assert_eq!(
&Name::from_labels(vec!["aaaa", "isi", "edu"]),
aaaa_record.name()
);
if let RData::AAAA(ref address) = *aaaa_record.rdata() {
assert_eq!(&Ipv6Addr::from_str("4321:0:1:2:3:4:567:89ab").unwrap(),
address);
assert_eq!(
&Ipv6Addr::from_str("4321:0:1:2:3:4:567:89ab").unwrap(),
address
);
} else {
panic!("Not a AAAA record!!!") // valid panic, test code
}
// SHORT
let short_record: &Record =
authority.lookup(&Name::new().label("short").label("isi").label("edu"),
RecordType::A,
false,
SupportedAlgorithms::new())
.first()
.cloned()
.unwrap();
assert_eq!(&Name::new().label("short").label("isi").label("edu"),
short_record.name());
let short_record: &Record = authority
.lookup(
&Name::from_labels(vec!["short", "isi", "edu"]),
RecordType::A,
false,
SupportedAlgorithms::new(),
)
.first()
.cloned()
.unwrap();
assert_eq!(
&Name::from_labels(vec!["short", "isi", "edu"]),
short_record.name()
);
assert_eq!(70, short_record.ttl());
if let RData::A(ref address) = *short_record.rdata() {
assert_eq!(&Ipv4Addr::new(26u8, 3u8, 0u8, 104u8), address);
@ -194,23 +217,30 @@ venera A 10.1.0.52
}
// TXT
let mut txt_records: Vec<&Record> =
authority.lookup(&Name::new().label("a").label("isi").label("edu"),
RecordType::TXT,
false,
SupportedAlgorithms::new());
let compare = vec![vec!["I".to_string(),
"am".to_string(),
"a".to_string(),
"txt".to_string(),
"record".to_string()],
vec!["I".to_string(),
"am".to_string(),
"another".to_string(),
"txt".to_string(),
"record".to_string()],
vec!["key=val".to_string()],
vec!["I am a different".to_string(), "txt record".to_string()]];
let mut txt_records: Vec<&Record> = authority.lookup(
&Name::from_labels(vec!["a", "isi", "edu"]),
RecordType::TXT,
false,
SupportedAlgorithms::new(),
);
let compare = vec![
vec![
"I".to_string(),
"am".to_string(),
"a".to_string(),
"txt".to_string(),
"record".to_string(),
],
vec![
"I".to_string(),
"am".to_string(),
"another".to_string(),
"txt".to_string(),
"record".to_string(),
],
vec!["key=val".to_string()],
vec!["I am a different".to_string(), "txt record".to_string()],
];
txt_records.sort();
@ -229,35 +259,30 @@ venera A 10.1.0.52
}
// PTR
let ptr_record: &Record = authority.lookup(&Name::new()
.label("103")
.label("0")
.label("3")
.label("26")
.label("in-addr")
.label("arpa"),
RecordType::PTR,
false,
SupportedAlgorithms::new())
let ptr_record: &Record = authority
.lookup(
&Name::from_labels(vec!["103", "0", "3", "26", "in-addr", "arpa"]),
RecordType::PTR,
false,
SupportedAlgorithms::new(),
)
.first()
.cloned()
.unwrap();
if let RData::PTR(ref ptrdname) = *ptr_record.rdata() {
assert_eq!(&Name::new().label("a").label("isi").label("edu"), ptrdname);
assert_eq!(&Name::from_labels(vec!["a", "isi", "edu"]), ptrdname);
} else {
panic!("Not a PTR record!!!") // valid panic, test code
}
// SRV
let srv_record: &Record = authority.lookup(&Name::new()
.label("_ldap")
.label("_tcp")
.label("service")
.label("isi")
.label("edu"),
RecordType::SRV,
false,
SupportedAlgorithms::new())
let srv_record: &Record = authority
.lookup(
&Name::from_labels(vec!["_ldap", "_tcp", "service", "isi", "edu"]),
RecordType::SRV,
false,
SupportedAlgorithms::new(),
)
.first()
.cloned()
.unwrap();
@ -265,8 +290,10 @@ venera A 10.1.0.52
assert_eq!(rdata.priority(), 1);
assert_eq!(rdata.weight(), 2);
assert_eq!(rdata.port(), 3);
assert_eq!(rdata.target(),
&Name::new().label("short").label("isi").label("edu"));
assert_eq!(
rdata.target(),
&Name::from_labels(vec!["short", "isi", "edu"])
);
} else {
panic!("Not an SRV record!!!") // valid panic, test code
}