summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/resolve_dns.ts18
-rw-r--r--cli/tests/testdata/resolve_dns.ts.out18
-rw-r--r--cli/tests/testdata/resolve_dns.zone.in24
3 files changed, 45 insertions, 15 deletions
diff --git a/cli/tests/testdata/resolve_dns.ts b/cli/tests/testdata/resolve_dns.ts
index 9b4364311..1e0fa08b8 100644
--- a/cli/tests/testdata/resolve_dns.ts
+++ b/cli/tests/testdata/resolve_dns.ts
@@ -1,15 +1,16 @@
const nameServer = { nameServer: { ipAddr: "127.0.0.1", port: 4553 } };
-const [a, aaaa, aname, cname, mx, ns, ptr, srv, txt] = await Promise.all([
+const [a, aaaa, aname, cname, mx, ns, ptr, soa, srv, txt] = await Promise.all([
Deno.resolveDns("www.example.com", "A", nameServer),
Deno.resolveDns("www.example.com", "AAAA", nameServer),
Deno.resolveDns("www.example.com", "ANAME", nameServer),
- Deno.resolveDns("foo", "CNAME", nameServer),
- Deno.resolveDns("www.example.com", "MX", nameServer),
- Deno.resolveDns("www.example.com", "NS", nameServer),
- Deno.resolveDns("5.6.7.8", "PTR", nameServer),
- Deno.resolveDns("_Service._TCP.example.com", "SRV", nameServer),
- Deno.resolveDns("www.example.com", "TXT", nameServer),
+ Deno.resolveDns("alias.example.com", "CNAME", nameServer),
+ Deno.resolveDns("example.com", "MX", nameServer),
+ Deno.resolveDns("example.com", "NS", nameServer),
+ Deno.resolveDns("1.2.3.4.IN-ADDR.ARPA.", "PTR", nameServer),
+ Deno.resolveDns("example.com", "SOA", nameServer),
+ Deno.resolveDns("_service._tcp.example.com", "SRV", nameServer),
+ Deno.resolveDns("example.com", "TXT", nameServer),
]);
console.log("A");
@@ -33,6 +34,9 @@ console.log(JSON.stringify(ns));
console.log("PTR");
console.log(JSON.stringify(ptr));
+console.log("SOA");
+console.log(JSON.stringify(soa));
+
console.log("SRV");
console.log(JSON.stringify(srv));
diff --git a/cli/tests/testdata/resolve_dns.ts.out b/cli/tests/testdata/resolve_dns.ts.out
index 2b56d72ae..487b55546 100644
--- a/cli/tests/testdata/resolve_dns.ts.out
+++ b/cli/tests/testdata/resolve_dns.ts.out
@@ -1,19 +1,21 @@
A
-["1.2.3.4"]
+["1.2.3.4","5.6.7.8"]
AAAA
["1:2:3:4:5:6:7:8"]
ANAME
-["aname.com."]
+["aname.example.com."]
CNAME
-["cname.com."]
+["cname.example.com."]
MX
-[{"preference":0,"exchange":"mx.com."}]
+[{"preference":10,"exchange":"mx1.com."},{"preference":20,"exchange":"mx2.com."}]
NS
-["ns1.ns.com."]
+["ns1.ns.com.","ns2.ns.com.","ns3.ns.com."]
PTR
-["ptr.com."]
+["www.example.com.","alias.example.com."]
+SOA
+[{"mname":"net.example.com.","rname":"admin\\.domain.example.com."}]
SRV
-[{"priority":0,"weight":100,"port":1234,"target":"srv.com."}]
+[{"priority":0,"weight":100,"port":1234,"target":"srv.example.com."}]
TXT
-[["foo","bar"]]
+[["I","am","a","txt","record"],["I","am","another","txt","record"],["I am a different","txt record"],["key=val"]]
Error NotFound thrown for not-found-example.com
diff --git a/cli/tests/testdata/resolve_dns.zone.in b/cli/tests/testdata/resolve_dns.zone.in
new file mode 100644
index 000000000..6b611bafa
--- /dev/null
+++ b/cli/tests/testdata/resolve_dns.zone.in
@@ -0,0 +1,24 @@
+@ IN SOA net admin\.domain (
+ 20 ; SERIAL
+ 7200 ; REFRESH
+ 600 ; RETRY
+ 3600000; EXPIRE
+ 60) ; MINIMUM
+ NS ns1.ns.com.
+ NS ns2.ns.com.
+ NS ns3.ns.com.
+ MX 10 mx1.com.
+ MX 20 mx2.com.
+ TXT I am a txt record
+ TXT I am another txt record
+ TXT "I am a different" "txt record"
+ TXT key=val
+www A 1.2.3.4
+ A 5.6.7.8
+ ANAME aname
+www AAAA 1:2:3:4:5:6:7:8
+alias CNAME cname
+
+1.2.3.4.IN-ADDR.ARPA. PTR www
+ PTR alias
+_service._tcp SRV 0 100 1234 srv \ No newline at end of file