more tests and test data

This commit is contained in:
AJ ONeal 2017-10-19 12:55:22 -06:00
parent 6ac53c1b05
commit 44f33c999d
2 changed files with 42 additions and 15 deletions

View File

@ -33,9 +33,16 @@ Test that A queries for ANAME-enabled records (but no address) recurse (regardle
Generally speaking test the cases of 0, 1, and 2 records of any given type (null case, single case, multi case)
```
port=65053
ns=localhost
digcmd="node bin/dig.js"
#digcmd="dig"
```
```
# Serve:
node bin/digd.js +norecurse -p 65053 --input sample/db.json
node bin/digd.js +norecurse -p $port --input sample/db.json
```
```
@ -46,16 +53,16 @@ node bin/digd.js +norecurse -p 65053 --input sample/db.json
# Test:
# should return NS records in AUTHORITY section, nothing else
node bin/dig.js @localhost -p 65053 A out-delegated.example.com
node bin/dig.js @localhost -p 65053 ANY out-delegated.example.com
$digcmd @$ns -p $port A out-delegated.example.com
node bin/dig.js @$ns -p $port ANY out-delegated.example.com
# should return SOA records in AUTHORITY section, nothing else
node bin/dig.js @localhost -p 65053 A in-delegated.example.com
node bin/dig.js @localhost -p 65053 ANY in-delegated.example.com
node bin/dig.js @$ns -p $port A in-delegated.example.com
node bin/dig.js @$ns -p $port ANY in-delegated.example.com
# should return NS records in ANSWER section, nothing else
node bin/dig.js @localhost -p 65053 NS out-delegated.example.com
node bin/dig.js @localhost -p 65053 NS in-delegated.example.com
node bin/dig.js @$ns -p $port NS out-delegated.example.com
node bin/dig.js @$ns -p $port NS in-delegated.example.com
# Sample Data:
@ -63,12 +70,17 @@ node bin/dig.js @localhost -p 65053 NS in-delegated.example.com
# no NS records
# Test:
# should return A records in ANSWER section, nothing else
node bin/dig.js @localhost -p 65053 A example.com
# should return records in ANSWER section, nothing else
node bin/dig.js @$ns -p $port A example.com
node bin/dig.js @$ns -p $port AAAA example.com
node bin/dig.js @$ns -p $port MX example.com
node bin/dig.js @$ns -p $port SRV example.com
node bin/dig.js @$ns -p $port TXT example.com
node bin/dig.js @$ns -p $port ANY example.com
# should return SOA records in AUTHORITY section, nothing else
node bin/dig.js @localhost -p 65053 A doesntexist.example.com
node bin/dig.js @localhost -p 65053 NS doesntexist.example.com
node bin/dig.js @$ns -p $port A doesntexist.example.com
node bin/dig.js @$ns -p $port NS doesntexist.example.com
# Sample Data:
@ -76,13 +88,24 @@ node bin/dig.js @localhost -p 65053 NS doesntexist.example.com
# has **internal** NS records
# Test:
# should return A record in ANSWER section, nothing else
node bin/dig.js @localhost -p 65053 A a.example.com
# should return record of correct type in ANSWER section, nothing else
node bin/dig.js @$ns -p $port A a.example.com
node bin/dig.js @$ns -p $port ANY a.example.com
node bin/dig.js @$ns -p $port AAAA aaaa.example.com
node bin/dig.js @$ns -p $port ANY aaaa.example.com
node bin/dig.js @$ns -p $port MX mx.example.com
node bin/dig.js @$ns -p $port ANY mx.example.com
node bin/dig.js @$ns -p $port SRV srv.example.com
node bin/dig.js @$ns -p $port ANY srv.example.com
node bin/dig.js @$ns -p $port TXT txt.example.com
node bin/dig.js @$ns -p $port ANY txt.example.com
node bin/dig.js @$ns -p $port TXT mtxt.example.com
node bin/dig.js @$ns -p $port ANY mtxt.example.com
# should return SOA record in AUTHORITY section, nothing else
node bin/dig.js @localhost -p 65053 A doesntexist.a.example.com
node bin/dig.js @$ns -p $port A doesntexist.a.example.com
# should return NS records in ANSWER section, nothing else
node bin/dig.js @localhost -p 65053 NS a.example.com
node bin/dig.js @$ns -p $port NS a.example.com
```

View File

@ -46,6 +46,10 @@ module.exports = {
, "type": "TXT", "data": [ "foo bar baz" ] }
, { "zone": "example.com", "name": "mtxt.example.com", "tld": "com", "sld": "example", "sub": "mtxt"
, "type": "TXT", "data": [ "foo", "bar", "baz" ] }
, { "zone": "example.com", "type": "NS", "name": "ns.example.com"
, "tld": "com", "sld": "example", "sub": "ns", "data": "ns1.vanity-dns.org" }
, { "zone": "example.com", "type": "NS", "name": "ns.example.com"
, "tld": "com", "sld": "example", "sub": "ns", "data": "ns2.vanity-dns.org" }
// www., email., etc just for fun
, { "zone": "example.com", "name": "www.example.com", "tld": "com", "sld": "example", "sub": "www"