Sfoglia il codice sorgente

Add integration test suite

These Specsheet tests (I said I was using it everywhere) test dog end-to-end by making network requests and asserting that the response is OK.
Benjamin Sago 4 anni fa
parent
commit
6d77070370
11 ha cambiato i file con 1012 aggiunte e 2 eliminazioni
  1. 10 2
      Justfile
  2. 10 0
      README.md
  3. 16 0
      xtests/README.md
  4. 56 0
      xtests/basics.toml
  5. 17 0
      xtests/errors.toml
  6. 58 0
      xtests/help.toml
  7. 169 0
      xtests/https.toml
  8. 169 0
      xtests/json.toml
  9. 169 0
      xtests/tcp.toml
  10. 169 0
      xtests/tls.toml
  11. 169 0
      xtests/udp.toml

+ 10 - 2
Justfile

@@ -1,5 +1,5 @@
-all: build test
-all-release: build-release test-release
+all: build test xtests
+all-release: build-release test-release xtests-release
 
 export DOG_DEBUG := ""
 
@@ -21,6 +21,14 @@ export DOG_DEBUG := ""
 @test-release:
     cargo test --release --all --verbose
 
+# runs extended tests
+@xtests:
+    specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/debug/dog"
+
+# runs extended tests (in release mode)
+@xtests-release:
+    specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/release/dog"
+
 # renders the documentation
 @doc args="":
     cargo doc --no-deps --all {{args}}

+ 10 - 0
README.md

@@ -68,6 +68,16 @@ To build, download the source code and run:
 And the binary will be present in `target/release/dog`.
 
 
+### Testing
+
+dog has an integration test suite written as [Specsheet](https://specsheet.software/) check documents.
+If you have a copy installed, you can run:
+
+    just xtests
+
+And it will test the compiled binary by making DNS requests over the network, checking that dog returns results and does not crash.
+
+
 ### Minimum supported Rust version
 
 Currently, dog is built and tested against the most recent stable Rust version, with no compatibility guarantees for any older versions.

+ 16 - 0
xtests/README.md

@@ -0,0 +1,16 @@
+# dog › xtests
+
+This is dog’s extended test suite. It gets run using [Specsheet]. They run a complete end-to-end set of tests, covering network connections, DNS protocol parsing, command-line options, and error handling.
+
+For completeness, this makes connections over the network. This means that the outcome of some of the tests is dependent on your own machine’s connectivity! It also means that your own IP address will be recorded as making the requests.
+
+The tests have the following set of Specsheet tags:
+
+- `live`: All tests that use the network.
+- `isp`: Tests that use your computer’s default resolver.
+- `google`: Tests that use the [public Google DNS resolver].
+- `cloudflare`: Tests that use the [public Cloudflare DNS resolver].
+
+[Specsheet]: https://specsheet.software/
+[public Google DNS resolver]: https://developers.google.com/speed/public-dns
+[public Cloudflare DNS resolver]: https://developers.cloudflare.com/1.1.1.1/

+ 56 - 0
xtests/basics.toml

@@ -0,0 +1,56 @@
+# Colour output
+
+[[cmd]]
+shell = "dog dns.google --colour=always"
+stdout = { string = "\u001B[1;32mA\u001B[0m \u001B[1;34mdns.google.\u001B[0m" }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+[[cmd]]
+shell = "dog dns.google"
+stdout = { string = "A dns.google." }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+[[cmd]]
+shell = "dog dns.google --colour=never"
+stdout = { string = "A dns.google." }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+
+# Default record type and transport
+
+[[cmd]]
+shell = "dog dns.google -U"
+stdout = { string = "A dns.google." }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+[[cmd]]
+shell = "dog A dns.google"
+stdout = { string = "A dns.google." }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+[[cmd]]
+shell = "dog A dns.google --time"
+stdout = { string = "Ran in" }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "google" ]
+
+
+# Network errors
+
+[[cmd]]
+shell = "dog A dns.google @non.exist --time"
+stdout = { string = "Ran in" }
+stderr = { string = "Error [network]" }
+status = 1
+tags = [ "live", "google" ]

+ 17 - 0
xtests/errors.toml

@@ -0,0 +1,17 @@
+[[cmd]]
+shell = "dog --wibble"
+stdout = { empty = true }
+stderr = { string = "wibble" }
+status = 3
+
+[[cmd]]
+shell = "dog XYZZY dns.google"
+stdout = { empty = true }
+stderr = { string = "XYZZY" }
+status = 3
+
+[[cmd]]
+shell = "dog OPT dns.google"
+stdout = { empty = true }
+stderr = { string = "OPT request is sent by default" }
+status = 3

+ 58 - 0
xtests/help.toml

@@ -0,0 +1,58 @@
+# help
+
+[[cmd]]
+shell = "dog --help"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --help --color=automatic"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --help --colour=always"
+stdout = { string = "dog \u001B[1;32m●\u001B[0m" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --help --color=never"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 3
+
+
+# versions
+
+[[cmd]]
+shell = "dog --version"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --version --colour=automatic"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --version --color=always"
+stdout = { string = "dog \u001B[1;32m●\u001B[0m" }
+stderr = { empty = true }
+status = 0
+
+[[cmd]]
+shell = "dog --version --colour=never"
+stdout = { string = "dog ●" }
+stderr = { empty = true }
+status = 0

+ 169 - 0
xtests/https.toml

@@ -0,0 +1,169 @@
+# A records
+
+[[cmd]]
+name = "Look up an existing A record using HTTPS"
+shell = "dog a-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '10.20.30.40' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing A record using HTTPS"
+shell = "dog non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# AAAA records
+
+[[cmd]]
+name = "Look up an existing AAAA record using HTTPS"
+shell = "dog AAAA aaaa-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '::1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing AAAA record using HTTPS"
+shell = "dog AAAA non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CAA records
+
+[[cmd]]
+name = "Look up an existing CAA record using HTTPS"
+shell = "dog CAA caa-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '"issue" "some.certificate.authority" (non-critical)' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing CAA record using HTTPS"
+shell = "dog CAA non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CNAME records
+
+[[cmd]]
+name = "Look up an existing CNAME record using HTTPS"
+shell = "dog CNAME cname-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '"dns.lookup.dog."' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing CNAME record using HTTPS"
+shell = "dog CNAME non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# MX records
+
+[[cmd]]
+name = "Look up an existing MX record using HTTPS"
+shell = "dog MX mx-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '10 "some.mail.server."' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing MX record using HTTPS"
+shell = "dog MX non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# NS records
+
+[[cmd]]
+name = "Look up an existing NS record using HTTPS"
+shell = "dog NS lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing NS record using HTTPS"
+shell = "dog NS non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SOA records
+
+[[cmd]]
+name = "Look up an existing SOA record using HTTPS"
+shell = "dog SOA lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SOA record using HTTPS"
+shell = "dog MX non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SRV records
+
+[[cmd]]
+name = "Look up an existing SRV record using HTTPS"
+shell = "dog SRV srv-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '20 "dns.lookup.dog.":5000' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SRV record using HTTPS"
+shell = "dog SRV non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# TXT records
+
+[[cmd]]
+name = "Look up an existing TXT record using HTTPS"
+shell = "dog TXT txt-example.lookup.dog @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { string = '"Cache Invalidation and Naming Things"' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing TXT record using HTTPS"
+shell = "dog TXT non.existent @https://cloudflare-dns.com/dns-query --short --https"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]

+ 169 - 0
xtests/json.toml

@@ -0,0 +1,169 @@
+# A records
+
+[[cmd]]
+name = "Look up an existing A record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing A record formatted as JSON"
+shell = "dog non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# AAAA records
+
+[[cmd]]
+name = "Look up an existing AAAA record formatted as JSON"
+shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --json"
+stdout = { string = '::1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing AAAA record formatted as JSON"
+shell = "dog AAAA non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# CAA records
+
+[[cmd]]
+name = "Look up an existing CAA record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CAA record formatted as JSON"
+shell = "dog CAA non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# CNAME records
+
+[[cmd]]
+name = "Look up an existing CNAME record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CNAME record formatted as JSON"
+shell = "dog CNAME non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# MX records
+
+[[cmd]]
+name = "Look up an existing MX record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing MX record formatted as JSON"
+shell = "dog MX non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# NS records
+
+[[cmd]]
+name = "Look up an existing NS record formatted as JSON"
+shell = "dog NS lookup.dog @1.1.1.1 --json"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing NS record formatted as JSON"
+shell = "dog NS non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# SOA records
+
+[[cmd]]
+name = "Look up an existing SOA record formatted as JSON"
+shell = "dog SOA lookup.dog @1.1.1.1 --json"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SOA record formatted as JSON"
+shell = "dog MX non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# SRV records
+
+[[cmd]]
+name = "Look up an existing SRV record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing SRV record formatted as JSON"
+shell = "dog SRV non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+
+# TXT records
+
+[[cmd]]
+name = "Look up an existing TXT record formatted as JSON"
+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" ]
+
+[[cmd]]
+name = "Look up a missing TXT record formatted as JSON"
+shell = "dog TXT non.existent @1.1.1.1 --json"
+stdout = { string = '[]' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]

+ 169 - 0
xtests/tcp.toml

@@ -0,0 +1,169 @@
+# A records
+
+[[cmd]]
+name = "Look up an existing A record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing A record using TCP"
+shell = "dog non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# AAAA records
+
+[[cmd]]
+name = "Look up an existing AAAA record using TCP"
+shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short --tcp"
+stdout = { string = '::1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing AAAA record using TCP"
+shell = "dog AAAA non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CAA records
+
+[[cmd]]
+name = "Look up an existing CAA record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CAA record using TCP"
+shell = "dog CAA non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CNAME records
+
+[[cmd]]
+name = "Look up an existing CNAME record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CNAME record using TCP"
+shell = "dog CNAME non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# MX records
+
+[[cmd]]
+name = "Look up an existing MX record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing MX record using TCP"
+shell = "dog MX non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# NS records
+
+[[cmd]]
+name = "Look up an existing NS record using TCP"
+shell = "dog NS lookup.dog @1.1.1.1 --short --tcp"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing NS record using TCP"
+shell = "dog NS non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SOA records
+
+[[cmd]]
+name = "Look up an existing SOA record using TCP"
+shell = "dog SOA lookup.dog @1.1.1.1 --short --tcp"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SOA record using TCP"
+shell = "dog MX non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SRV records
+
+[[cmd]]
+name = "Look up an existing SRV record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing SRV record using TCP"
+shell = "dog SRV non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# TXT records
+
+[[cmd]]
+name = "Look up an existing TXT record using TCP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing TXT record using TCP"
+shell = "dog TXT non.existent @1.1.1.1 --short --tcp"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]

+ 169 - 0
xtests/tls.toml

@@ -0,0 +1,169 @@
+# A records
+
+[[cmd]]
+name = "Look up an existing A record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing A record using TLS"
+shell = "dog non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# AAAA records
+
+[[cmd]]
+name = "Look up an existing AAAA record using TLS"
+shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short --tls"
+stdout = { string = '::1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing AAAA record using TLS"
+shell = "dog AAAA non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CAA records
+
+[[cmd]]
+name = "Look up an existing CAA record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CAA record using TLS"
+shell = "dog CAA non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CNAME records
+
+[[cmd]]
+name = "Look up an existing CNAME record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CNAME record using TLS"
+shell = "dog CNAME non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# MX records
+
+[[cmd]]
+name = "Look up an existing MX record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing MX record using TLS"
+shell = "dog MX non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# NS records
+
+[[cmd]]
+name = "Look up an existing NS record using TLS"
+shell = "dog NS lookup.dog @1.1.1.1 --short --tls"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing NS record using TLS"
+shell = "dog NS non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SOA records
+
+[[cmd]]
+name = "Look up an existing SOA record using TLS"
+shell = "dog SOA lookup.dog @1.1.1.1 --short --tls"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SOA record using TLS"
+shell = "dog MX non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SRV records
+
+[[cmd]]
+name = "Look up an existing SRV record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing SRV record using TLS"
+shell = "dog SRV non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# TXT records
+
+[[cmd]]
+name = "Look up an existing TXT record using TLS"
+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" ]
+
+[[cmd]]
+name = "Look up a missing TXT record using TLS"
+shell = "dog TXT non.existent @1.1.1.1 --short --tls"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]

+ 169 - 0
xtests/udp.toml

@@ -0,0 +1,169 @@
+# A records
+
+[[cmd]]
+name = "Look up an existing A record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing A record using UDP"
+shell = "dog non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# AAAA records
+
+[[cmd]]
+name = "Look up an existing AAAA record using UDP"
+shell = "dog AAAA aaaa-example.lookup.dog @1.1.1.1 --short"
+stdout = { string = '::1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing AAAA record using UDP"
+shell = "dog AAAA non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CAA records
+
+[[cmd]]
+name = "Look up an existing CAA record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CAA record using UDP"
+shell = "dog CAA non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# CNAME records
+
+[[cmd]]
+name = "Look up an existing CNAME record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing CNAME record using UDP"
+shell = "dog CNAME non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# MX records
+
+[[cmd]]
+name = "Look up an existing MX record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing MX record using UDP"
+shell = "dog MX non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# NS records
+
+[[cmd]]
+name = "Look up an existing NS record using UDP"
+shell = "dog NS lookup.dog @1.1.1.1 --short"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing NS record using UDP"
+shell = "dog NS non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SOA records
+
+[[cmd]]
+name = "Look up an existing SOA record using UDP"
+shell = "dog SOA lookup.dog @1.1.1.1 --short"
+stdout = { string = 'ns1' }
+stderr = { empty = true }
+status = 0
+tags = [ "live", "cloudflare" ]
+
+[[cmd]]
+name = "Look up a missing SOA record using UDP"
+shell = "dog MX non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# SRV records
+
+[[cmd]]
+name = "Look up an existing SRV record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing SRV record using UDP"
+shell = "dog SRV non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]
+
+
+# TXT records
+
+[[cmd]]
+name = "Look up an existing TXT record using UDP"
+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" ]
+
+[[cmd]]
+name = "Look up a missing TXT record using UDP"
+shell = "dog TXT non.existent @1.1.1.1 --short"
+stdout = { empty = true }
+stderr = { string = "No results" }
+status = 2
+tags = [ "live", "cloudflare" ]