Pārlūkot izejas kodu

Tag tests and use Cargo features for quick mode

While working on the DNS wire format crate, I've found it annoying that my standard compile-test-xtests loop involves linking in the TLS and HTTPS dependencies, then running the tests for every transport, when I know all I've changed is the protocol parsing parts.

So now there's the "all-quick" Justfile target, which disables these features and runs fewer of the tests. This has noticeable build speed improvements:

• building and linking from a modified 'dns' crate has gone from 3.5s → 1.6s
• a clean build has gone from 28s → 14s
• an entire clean cycle has gone from 38s → 17s

The "all" Justfile target remains the default one, as it's the recommended way to test dog with all its features. But the increased linking speed will be helpful, development-wise.
Benjamin Sago 4 gadi atpakaļ
vecāks
revīzija
24e71f4d08

+ 5 - 0
Cargo.toml

@@ -50,3 +50,8 @@ regex = { version = "1.3", default_features = false, features = ["std"] }
 
 [dev-dependencies]
 pretty_assertions = "0.6"
+
+[features]
+default = ["tls", "https"]
+tls = ["dns-transport/tls"]
+https = ["dns-transport/https"]

+ 13 - 0
Justfile

@@ -1,5 +1,6 @@
 all: build test xtests
 all-release: build-release test-release xtests-release
+all-quick: build-quick test-quick xtests-quick
 
 export DOG_DEBUG := ""
 
@@ -13,6 +14,10 @@ export DOG_DEBUG := ""
     cargo build --release --verbose
     strip target/release/dog
 
+# compiles the dog binary (without some features)
+@build-quick:
+    cargo build --no-default-features
+
 
 # runs unit tests
 @test:
@@ -22,6 +27,10 @@ export DOG_DEBUG := ""
 @test-release:
     cargo test --release --all --verbose
 
+# runs unit tests (without some features)
+@test-quick:
+    cargo test --workspace --no-default-features -- --quiet
+
 # runs mutation tests
 @test-mutation:
     cargo +nightly test    --package dns --features=dns/with_mutagen -- --quiet
@@ -36,6 +45,10 @@ export DOG_DEBUG := ""
 @xtests-release:
     specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/release/dog"
 
+# runs extended tests (omitting certain feature tests)
+@xtests-quick:
+    specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/debug/dog" --skip-tags=udp,tls,https,json
+
 
 # runs fuzzing on the dns crate
 @fuzz:

+ 14 - 5
dns-transport/Cargo.toml

@@ -14,10 +14,19 @@ dns = { path = "../dns" }
 # logging
 log = "0.4"
 
-# networking
+# base networking
 async-trait = "0.1"
-hyper = "0.13"
-hyper-tls = "0.4"
-native-tls = "0.2"
 tokio = { version = "0.2", features = ["dns", "tcp", "udp", "io-util"] }  # dns is used to resolve nameservers
-tokio-tls = "0.3"
+tokio-tls = { version = "0.3", optional = true }
+
+# tls
+native-tls = { version = "0.2", optional = true }
+
+# https
+hyper = { version = "0.13", optional = true }
+hyper-tls = { version = "0.4", optional = true }
+
+[features]
+default = []  # these are enabled in the main dog crate
+tls = ["native-tls", "tokio-tls"]
+https = ["hyper", "hyper-tls"]

+ 14 - 7
dns-transport/src/https.rs

@@ -1,8 +1,6 @@
+#![cfg_attr(not(feature="https"), allow(unused))]
+
 use async_trait::async_trait;
-use hyper_tls::HttpsConnector;
-use hyper::Body;
-use hyper::body::HttpBody as _;
-use hyper::Client;
 use log::*;
 
 use dns::{Request, Response};
@@ -48,9 +46,13 @@ impl HttpsTransport {
 
 #[async_trait]
 impl Transport for HttpsTransport {
+
+    #[cfg(feature="https")]
     async fn send(&self, request: &Request) -> Result<Response, Error> {
-        let https = HttpsConnector::new();
-        let client = Client::builder().build::<_, hyper::Body>(https);
+        use hyper::body::HttpBody as _;
+
+        let https = hyper_tls::HttpsConnector::new();
+        let client = hyper::Client::builder().build::<_, hyper::Body>(https);
 
         let bytes = request.to_bytes().expect("failed to serialise request");
         info!("Sending {} bytes of data to {:?}", bytes.len(), self.url);
@@ -60,7 +62,7 @@ impl Transport for HttpsTransport {
             .uri(&self.url)
             .header("Content-Type", "application/dns-message")
             .header("Accept",       "application/dns-message")
-            .body(Body::from(bytes))
+            .body(hyper::Body::from(bytes))
             .expect("Failed to build request");  // we control the request, so this should never fail
 
         let mut response = client.request(request).await?;
@@ -82,4 +84,9 @@ impl Transport for HttpsTransport {
 
         Ok(response)
     }
+
+    #[cfg(not(feature="https"))]
+    async fn send(&self, _request: &Request) -> Result<Response, Error> {
+        unimplemented!("HTTPS feature disabled")
+    }
 }

+ 2 - 0
dns-transport/src/lib.rs

@@ -70,9 +70,11 @@ pub enum Error {
     NetworkError(tokio::io::Error),
 
     /// There was a problem making an HTTPS request.
+    #[cfg(feature="https")]
     HttpError(hyper::Error),
 
     /// There was a problem making a TLS request.
+    #[cfg(feature="tls")]
     TlsError(native_tls::Error),
 
     /// The data in the response did not parse correctly from the DNS wire

+ 10 - 2
dns-transport/src/tls.rs

@@ -1,8 +1,9 @@
+#![cfg_attr(not(feature="tls"), allow(unused))]
+
 use std::convert::TryFrom;
 
 use async_trait::async_trait;
 use log::*;
-use native_tls::TlsConnector;
 use tokio::io::{AsyncReadExt, AsyncWriteExt};
 use tokio::net::TcpStream;
 
@@ -50,8 +51,10 @@ impl TlsTransport {
 
 #[async_trait]
 impl Transport for TlsTransport {
+
+    #[cfg(feature="tls")]
     async fn send(&self, request: &Request) -> Result<Response, Error> {
-        let connector = TlsConnector::new()?;
+        let connector = native_tls::TlsConnector::new()?;
         let connector = tokio_tls::TlsConnector::from(connector);
 
         info!("Opening TLS socket");
@@ -87,6 +90,11 @@ impl Transport for TlsTransport {
 
         Ok(response)
     }
+
+    #[cfg(not(feature="tls"))]
+    async fn send(&self, _request: &Request) -> Result<Response, Error> {
+        unimplemented!("TLS feature disabled")
+    }
 }
 
 impl TlsTransport {

+ 5 - 1
src/output.rs

@@ -430,7 +430,9 @@ pub fn print_error_code(rcode: ErrorCode) {
 fn erroneous_phase(error: &TransportError) -> &'static str {
 	match error {
 		TransportError::NetworkError(_)  => "network",
-		TransportError::HttpError(_)     => "http",
+        #[cfg(feature="https")]
+        TransportError::HttpError(_)     => "http",
+        #[cfg(feature="tls")]
 		TransportError::TlsError(_)      => "tls",
 		TransportError::BadRequest       => "http-status",
 		TransportError::WireError(_)     => "protocol",
@@ -441,7 +443,9 @@ fn erroneous_phase(error: &TransportError) -> &'static str {
 fn error_message(error: TransportError) -> String {
 	match error {
 		TransportError::NetworkError(e)  => e.to_string(),
+        #[cfg(feature="https")]
 		TransportError::HttpError(e)     => e.to_string(),
+        #[cfg(feature="tls")]
 		TransportError::TlsError(e)      => e.to_string(),
 		TransportError::BadRequest       => "Nameserver returned HTTP 400 Bad Request".into(),
 		TransportError::WireError(e)     => wire_error_message(e),

+ 8 - 8
xtests/badssl.toml

@@ -6,7 +6,7 @@ shell = "dog --https @https://expired.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server with the wrong host in the certificate"
@@ -14,7 +14,7 @@ shell = "dog --https @https://wrong.host.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server with a self-signed certificate"
@@ -22,7 +22,7 @@ shell = "dog --https @https://self-signed.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server with an untrusted root certificate"
@@ -30,7 +30,7 @@ shell = "dog --https @https://untrusted-root.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server with a revoked certificate"
@@ -38,7 +38,7 @@ shell = "dog --https @https://revoked.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server with a known bad certificate"
@@ -46,7 +46,7 @@ shell = "dog --https @https://superfish.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: The certificate was not trusted." }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 
 # Handshake failures
@@ -57,7 +57,7 @@ shell = "dog --https @https://null.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: handshake failure" }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]
 
 [[cmd]]
 name = "Using a DNS-over-HTTPS server that accepts the rc4-md5 cipher"
@@ -65,4 +65,4 @@ shell = "dog --https @https://rc4-md5.badssl.com/ lookup.dog"
 stdout = { empty = true }
 stderr = { string = "Error [http]: error trying to connect: handshake failure" }
 status = 1
-tags = [ 'live', 'badssl' ]
+tags = [ 'live', 'badssl', 'https' ]

+ 20 - 20
xtests/https.toml

@@ -6,7 +6,7 @@ shell = "dog a-example.lookup.dog @https://cloudflare-dns.com/dns-query --short
 stdout = { string = '10.20.30.40' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "a" ]
 
 [[cmd]]
 name = "Look up a missing A record using HTTPS"
@@ -14,7 +14,7 @@ shell = "dog non.existent @https://cloudflare-dns.com/dns-query --short --https"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "a" ]
 
 
 # AAAA records
@@ -25,7 +25,7 @@ shell = "dog AAAA aaaa-example.lookup.dog @https://cloudflare-dns.com/dns-query
 stdout = { string = '::1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "aaaa" ]
 
 [[cmd]]
 name = "Look up a missing AAAA record using HTTPS"
@@ -33,7 +33,7 @@ shell = "dog AAAA non.existent @https://cloudflare-dns.com/dns-query --short --h
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "aaaa" ]
 
 
 # CAA records
@@ -44,7 +44,7 @@ shell = "dog CAA caa-example.lookup.dog @https://cloudflare-dns.com/dns-query --
 stdout = { string = '"issue" "some.certificate.authority" (non-critical)' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "caa" ]
 
 [[cmd]]
 name = "Look up a missing CAA record using HTTPS"
@@ -52,7 +52,7 @@ shell = "dog CAA non.existent @https://cloudflare-dns.com/dns-query --short --ht
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "caa" ]
 
 
 # CNAME records
@@ -63,7 +63,7 @@ shell = "dog CNAME cname-example.lookup.dog @https://cloudflare-dns.com/dns-quer
 stdout = { string = '"dns.lookup.dog."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "cname" ]
 
 [[cmd]]
 name = "Look up a missing CNAME record using HTTPS"
@@ -71,7 +71,7 @@ shell = "dog CNAME non.existent @https://cloudflare-dns.com/dns-query --short --
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "cname" ]
 
 
 # HINFO records
@@ -82,7 +82,7 @@ shell = "dog HINFO hinfo-example.lookup.dog @https://cloudflare-dns.com/dns-quer
 stdout = { string = '"some-kinda-os"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "hinfo" ]
 
 [[cmd]]
 name = "Look up a missing HINFO record using HTTPS"
@@ -90,7 +90,7 @@ shell = "dog HINFO non.existent @https://cloudflare-dns.com/dns-query --short --
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "hinfo" ]
 
 
 # MX records
@@ -101,7 +101,7 @@ shell = "dog MX mx-example.lookup.dog @https://cloudflare-dns.com/dns-query --sh
 stdout = { string = '10 "some.mail.server."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "mx" ]
 
 [[cmd]]
 name = "Look up a missing MX record using HTTPS"
@@ -109,7 +109,7 @@ shell = "dog MX non.existent @https://cloudflare-dns.com/dns-query --short --htt
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "mx" ]
 
 
 # NS records
@@ -120,7 +120,7 @@ shell = "dog NS lookup.dog @https://cloudflare-dns.com/dns-query --short --https
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "ns" ]
 
 [[cmd]]
 name = "Look up a missing NS record using HTTPS"
@@ -128,7 +128,7 @@ shell = "dog NS non.existent @https://cloudflare-dns.com/dns-query --short --htt
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "ns" ]
 
 
 # SOA records
@@ -139,7 +139,7 @@ shell = "dog SOA lookup.dog @https://cloudflare-dns.com/dns-query --short --http
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "soa" ]
 
 [[cmd]]
 name = "Look up a missing SOA record using HTTPS"
@@ -147,7 +147,7 @@ shell = "dog MX non.existent @https://cloudflare-dns.com/dns-query --short --htt
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "soa" ]
 
 
 # SRV records
@@ -158,7 +158,7 @@ shell = "dog SRV srv-example.lookup.dog @https://cloudflare-dns.com/dns-query --
 stdout = { string = '20 "dns.lookup.dog.":5000' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "srv" ]
 
 [[cmd]]
 name = "Look up a missing SRV record using HTTPS"
@@ -166,7 +166,7 @@ shell = "dog SRV non.existent @https://cloudflare-dns.com/dns-query --short --ht
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "srv" ]
 
 
 # TXT records
@@ -177,7 +177,7 @@ shell = "dog TXT txt-example.lookup.dog @https://cloudflare-dns.com/dns-query --
 stdout = { string = '"Cache Invalidation and Naming Things"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "txt" ]
 
 [[cmd]]
 name = "Look up a missing TXT record using HTTPS"
@@ -185,4 +185,4 @@ shell = "dog TXT non.existent @https://cloudflare-dns.com/dns-query --short --ht
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "https", "txt" ]

+ 20 - 20
xtests/json.toml

@@ -6,7 +6,7 @@ shell = "dog a-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '10.20.30.40' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "a" ]
 
 [[cmd]]
 name = "Look up a missing A record formatted as JSON"
@@ -14,7 +14,7 @@ shell = "dog non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "a" ]
 
 
 # AAAA records
@@ -25,7 +25,7 @@ shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '::1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "aaaa" ]
 
 [[cmd]]
 name = "Look up a missing AAAA record formatted as JSON"
@@ -33,7 +33,7 @@ shell = "dog AAAA non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "aaaa" ]
 
 
 # CAA records
@@ -44,7 +44,7 @@ shell = "dog CAA caa-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '"some.certificate.authority"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "caa" ]
 
 [[cmd]]
 name = "Look up a missing CAA record formatted as JSON"
@@ -52,7 +52,7 @@ shell = "dog CAA non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "caa" ]
 
 
 # CNAME records
@@ -63,7 +63,7 @@ shell = "dog CNAME cname-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '"dns.lookup.dog."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "cname" ]
 
 [[cmd]]
 name = "Look up a missing CNAME record formatted as JSON"
@@ -71,7 +71,7 @@ shell = "dog CNAME non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "cname" ]
 
 
 # HINFO records
@@ -82,7 +82,7 @@ shell = "dog HINFO hinfo-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '"some-kinda-os"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "hinfo" ]
 
 [[cmd]]
 name = "Look up a missing HINFO record formatted as JSON"
@@ -90,7 +90,7 @@ shell = "dog HINFO non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "hinfo" ]
 
 
 # MX records
@@ -101,7 +101,7 @@ shell = "dog MX mx-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = 'some.mail.server.' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "mx" ]
 
 [[cmd]]
 name = "Look up a missing MX record formatted as JSON"
@@ -109,7 +109,7 @@ shell = "dog MX non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "mx" ]
 
 
 # NS records
@@ -120,7 +120,7 @@ shell = "dog NS lookup.dog @1.1.1.1 --json"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "ns" ]
 
 [[cmd]]
 name = "Look up a missing NS record formatted as JSON"
@@ -128,7 +128,7 @@ shell = "dog NS non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "ns" ]
 
 
 # SOA records
@@ -139,7 +139,7 @@ shell = "dog SOA lookup.dog @1.1.1.1 --json"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "soa" ]
 
 [[cmd]]
 name = "Look up a missing SOA record formatted as JSON"
@@ -147,7 +147,7 @@ shell = "dog MX non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "soa" ]
 
 
 # SRV records
@@ -158,7 +158,7 @@ shell = "dog SRV srv-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = 'dns.lookup.dog.' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "srv" ]
 
 [[cmd]]
 name = "Look up a missing SRV record formatted as JSON"
@@ -166,7 +166,7 @@ shell = "dog SRV non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "srv" ]
 
 
 # TXT records
@@ -177,7 +177,7 @@ shell = "dog TXT txt-example.lookup.dog @1.1.1.1 --json"
 stdout = { string = '"Cache Invalidation and Naming Things"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "txt" ]
 
 [[cmd]]
 name = "Look up a missing TXT record formatted as JSON"
@@ -185,4 +185,4 @@ shell = "dog TXT non.existent @1.1.1.1 --json"
 stdout = { string = '[]' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "json", "txt" ]

+ 20 - 20
xtests/tcp.toml

@@ -6,7 +6,7 @@ shell = "dog a-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '10.20.30.40' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "a" ]
 
 [[cmd]]
 name = "Look up a missing A record using TCP"
@@ -14,7 +14,7 @@ shell = "dog non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "a" ]
 
 
 # AAAA records
@@ -25,7 +25,7 @@ shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '::1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "aaaa" ]
 
 [[cmd]]
 name = "Look up a missing AAAA record using TCP"
@@ -33,7 +33,7 @@ shell = "dog AAAA non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "aaaa" ]
 
 
 # CAA records
@@ -44,7 +44,7 @@ shell = "dog CAA caa-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '"issue" "some.certificate.authority" (non-critical)' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "caa" ]
 
 [[cmd]]
 name = "Look up a missing CAA record using TCP"
@@ -52,7 +52,7 @@ shell = "dog CAA non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "caa" ]
 
 
 # CNAME records
@@ -63,7 +63,7 @@ shell = "dog CNAME cname-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '"dns.lookup.dog."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "cname" ]
 
 [[cmd]]
 name = "Look up a missing CNAME record using TCP"
@@ -71,7 +71,7 @@ shell = "dog CNAME non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "cname" ]
 
 
 # HINFO records
@@ -82,7 +82,7 @@ shell = "dog HINFO hinfo-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '"some-kinda-cpu"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "hinfo" ]
 
 [[cmd]]
 name = "Look up a missing HINFO record using TCP"
@@ -90,7 +90,7 @@ shell = "dog HINFO non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "hinfo" ]
 
 
 # MX records
@@ -101,7 +101,7 @@ shell = "dog MX mx-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '10 "some.mail.server."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "mx" ]
 
 [[cmd]]
 name = "Look up a missing MX record using TCP"
@@ -109,7 +109,7 @@ shell = "dog MX non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "mx" ]
 
 
 # NS records
@@ -120,7 +120,7 @@ shell = "dog NS lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "ns" ]
 
 [[cmd]]
 name = "Look up a missing NS record using TCP"
@@ -128,7 +128,7 @@ shell = "dog NS non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "ns" ]
 
 
 # SOA records
@@ -139,7 +139,7 @@ shell = "dog SOA lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "soa" ]
 
 [[cmd]]
 name = "Look up a missing SOA record using TCP"
@@ -147,7 +147,7 @@ shell = "dog MX non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "soa" ]
 
 
 # SRV records
@@ -158,7 +158,7 @@ shell = "dog SRV srv-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '20 "dns.lookup.dog.":5000' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "srv" ]
 
 [[cmd]]
 name = "Look up a missing SRV record using TCP"
@@ -166,7 +166,7 @@ shell = "dog SRV non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "srv" ]
 
 
 # TXT records
@@ -177,7 +177,7 @@ shell = "dog TXT txt-example.lookup.dog @1.1.1.1 --short --tcp"
 stdout = { string = '"Cache Invalidation and Naming Things"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "txt" ]
 
 [[cmd]]
 name = "Look up a missing TXT record using TCP"
@@ -185,4 +185,4 @@ shell = "dog TXT non.existent @1.1.1.1 --short --tcp"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tcp", "txt" ]

+ 20 - 20
xtests/tls.toml

@@ -6,7 +6,7 @@ shell = "dog a-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '10.20.30.40' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "a" ]
 
 [[cmd]]
 name = "Look up a missing A record using TLS"
@@ -14,7 +14,7 @@ shell = "dog non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "a" ]
 
 
 # AAAA records
@@ -25,7 +25,7 @@ shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '::1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "aaaa" ]
 
 [[cmd]]
 name = "Look up a missing AAAA record using TLS"
@@ -33,7 +33,7 @@ shell = "dog AAAA non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "aaaa" ]
 
 
 # CAA records
@@ -44,7 +44,7 @@ shell = "dog CAA caa-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '"issue" "some.certificate.authority" (non-critical)' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "caa" ]
 
 [[cmd]]
 name = "Look up a missing CAA record using TLS"
@@ -52,7 +52,7 @@ shell = "dog CAA non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "caa" ]
 
 
 # CNAME records
@@ -63,7 +63,7 @@ shell = "dog CNAME cname-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '"dns.lookup.dog."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "cname" ]
 
 [[cmd]]
 name = "Look up a missing CNAME record using TLS"
@@ -71,7 +71,7 @@ shell = "dog CNAME non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "cname" ]
 
 
 # CNAME records
@@ -82,7 +82,7 @@ shell = "dog HINFO hinfo-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '"some-kinda-os"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "hinfo" ]
 
 [[cmd]]
 name = "Look up a missing HINFO record using TLS"
@@ -90,7 +90,7 @@ shell = "dog HINFO non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "hinfo" ]
 
 
 # MX records
@@ -101,7 +101,7 @@ shell = "dog MX mx-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '10 "some.mail.server."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "mx" ]
 
 [[cmd]]
 name = "Look up a missing MX record using TLS"
@@ -109,7 +109,7 @@ shell = "dog MX non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "mx" ]
 
 
 # NS records
@@ -120,7 +120,7 @@ shell = "dog NS lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "ns" ]
 
 [[cmd]]
 name = "Look up a missing NS record using TLS"
@@ -128,7 +128,7 @@ shell = "dog NS non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "ns" ]
 
 
 # SOA records
@@ -139,7 +139,7 @@ shell = "dog SOA lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "soa" ]
 
 [[cmd]]
 name = "Look up a missing SOA record using TLS"
@@ -147,7 +147,7 @@ shell = "dog MX non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "soa" ]
 
 
 # SRV records
@@ -158,7 +158,7 @@ shell = "dog SRV srv-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '20 "dns.lookup.dog.":5000' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "srv" ]
 
 [[cmd]]
 name = "Look up a missing SRV record using TLS"
@@ -166,7 +166,7 @@ shell = "dog SRV non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "srv" ]
 
 
 # TXT records
@@ -177,7 +177,7 @@ shell = "dog TXT txt-example.lookup.dog @1.1.1.1 --short --tls"
 stdout = { string = '"Cache Invalidation and Naming Things"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "txt" ]
 
 [[cmd]]
 name = "Look up a missing TXT record using TLS"
@@ -185,4 +185,4 @@ shell = "dog TXT non.existent @1.1.1.1 --short --tls"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "tls", "txt" ]

+ 20 - 20
xtests/udp.toml

@@ -6,7 +6,7 @@ shell = "dog a-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '10.20.30.40' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "a" ]
 
 [[cmd]]
 name = "Look up a missing A record using UDP"
@@ -14,7 +14,7 @@ shell = "dog non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "a" ]
 
 
 # AAAA records
@@ -25,7 +25,7 @@ shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '::1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "aaaa" ]
 
 [[cmd]]
 name = "Look up a missing AAAA record using UDP"
@@ -33,7 +33,7 @@ shell = "dog AAAA non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "aaaa" ]
 
 
 # CAA records
@@ -44,7 +44,7 @@ shell = "dog CAA caa-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '"issue" "some.certificate.authority" (non-critical)' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "caa" ]
 
 [[cmd]]
 name = "Look up a missing CAA record using UDP"
@@ -52,7 +52,7 @@ shell = "dog CAA non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "caa" ]
 
 
 # CNAME records
@@ -63,7 +63,7 @@ shell = "dog CNAME cname-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '"dns.lookup.dog."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "cname" ]
 
 [[cmd]]
 name = "Look up a missing CNAME record using UDP"
@@ -71,7 +71,7 @@ shell = "dog CNAME non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "cname" ]
 
 
 # CNAME records
@@ -82,7 +82,7 @@ shell = "dog HINFO hinfo-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '"some-kinda-cpu"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "hinfo" ]
 
 [[cmd]]
 name = "Look up a missing HINFO record using UDP"
@@ -90,7 +90,7 @@ shell = "dog HINFO non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "hinfo" ]
 
 
 # MX records
@@ -101,7 +101,7 @@ shell = "dog MX mx-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '10 "some.mail.server."' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "mx" ]
 
 [[cmd]]
 name = "Look up a missing MX record using UDP"
@@ -109,7 +109,7 @@ shell = "dog MX non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "mx" ]
 
 
 # NS records
@@ -120,7 +120,7 @@ shell = "dog NS lookup.dog @1.1.1.1 --short"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "ns" ]
 
 [[cmd]]
 name = "Look up a missing NS record using UDP"
@@ -128,7 +128,7 @@ shell = "dog NS non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "ns" ]
 
 
 # SOA records
@@ -139,7 +139,7 @@ shell = "dog SOA lookup.dog @1.1.1.1 --short"
 stdout = { string = 'ns1' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "soa" ]
 
 [[cmd]]
 name = "Look up a missing SOA record using UDP"
@@ -147,7 +147,7 @@ shell = "dog MX non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "soa" ]
 
 
 # SRV records
@@ -158,7 +158,7 @@ shell = "dog SRV srv-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '20 "dns.lookup.dog.":5000' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "srv" ]
 
 [[cmd]]
 name = "Look up a missing SRV record using UDP"
@@ -166,7 +166,7 @@ shell = "dog SRV non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "srv" ]
 
 
 # TXT records
@@ -177,7 +177,7 @@ shell = "dog TXT txt-example.lookup.dog @1.1.1.1 --short"
 stdout = { string = '"Cache Invalidation and Naming Things"' }
 stderr = { empty = true }
 status = 0
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "txt" ]
 
 [[cmd]]
 name = "Look up a missing TXT record using UDP"
@@ -185,4 +185,4 @@ shell = "dog TXT non.existent @1.1.1.1 --short"
 stdout = { empty = true }
 stderr = { string = "No results" }
 status = 2
-tags = [ "live", "cloudflare" ]
+tags = [ "live", "cloudflare", "udp", "txt" ]