summaryrefslogtreecommitdiffstats
path: root/debian/tests/kdig
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/kdig')
-rwxr-xr-xdebian/tests/kdig16
1 files changed, 16 insertions, 0 deletions
diff --git a/debian/tests/kdig b/debian/tests/kdig
new file mode 100755
index 0000000..3e8e58f
--- /dev/null
+++ b/debian/tests/kdig
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+expected=93.184.216.34
+answer=$(kdig +short +tls-ca +tls-hostname=dns.cmrg.net @dns.cmrg.net example.org 2>&1 || true)
+
+if [ "$answer" != "$expected" ]; then
+ # fallback to port 443/tcp (in case it cannot reach 853)
+ answer=$(kdig +short +tls-ca +tls-hostname=dns.cmrg.net -p 443 @dns.cmrg.net example.org 2>&1 || true)
+fi
+
+if [ "$answer" != "$expected" ]; then
+ printf "expected: %s\ngot: %s\n" "$expected" "$answer" >&2
+ kdig +tls-ca +tls-hostname=dns.cmrg.net @dns.cmrg.net example.org
+fi