Skip to content
Snippets Groups Projects
Commit 88809247 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Added tests on ORIGIN directive

refs #2041 @3h
parent dacfadc4
No related branches found
No related tags found
No related merge requests found
Showing
with 177 additions and 4 deletions
#!/bin/bash
mkdir /tmp/tests
separation="========================================================="
echo $separation
for file in `/usr/bin/find ./tests/ -name "*.in" | /usr/bin/sort`; do
fileout=`echo "$file" | /bin/sed 's/.in/.out/'`
../../unittests-zscanner -m 2 . $file > /tmp/_zscanner_test
/bin/sed --in-place 's/Zone processing has stopped.*//' /tmp/_zscanner_test
# ../../unittests-zscanner -m 2 . $file > /tmp/$fileout
../../unittests-zscanner -m 2 . $file > /tmp/$fileout
/bin/sed --in-place 's/Zone processing has stopped.*//' /tmp/$fileout
echo $fileout
diff /tmp/_zscanner_test $fileout
diff /tmp/$fileout $fileout
echo $separation
done
......@@ -24,6 +24,7 @@ b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. NS @ ;
& NS @ ; Bad (unslashed) character
a*a NS @ ; * char can substitute whole label only
NS @ ; Bad previous
.a NS @ ; Leading dot
@@ NS @ ; Double @@
.. NS @ ; Missing label between dots
\1 NS @ ; Slash notation requires 3 digits
......
......@@ -110,6 +110,8 @@ ERROR=ZSCANNER_EBAD_DNAME_CHAR
------
ERROR=ZSCANNER_EBAD_DNAME_CHAR
------
ERROR=ZSCANNER_EBAD_DNAME_CHAR
------
ERROR=ZSCANNER_EBAD_NUMBER
------
ERROR=ZSCANNER_EBAD_NUMBER
......
$TTL 1
; OK
$ORIGIN . ; Root domain
@ NS @ ; Use origin
a. NS @ ; Absolute dname
a NS @ ; Relative dname
$ORIGIN tld. ; 1. level domain
@ NS @ ; Use origin
a. NS @ ; Absolute dname
a NS @ ; Relative dname
$ORIGIN second.tld. ; 2. level domain
@ NS @ ; Use origin
a. NS @ ; Absolute dname
a NS @ ; Relative dname
$ORIGIN \0320\ \\\"\.\@\*.tld. ; Label with special chars
@ NS @ ; Use origin
$ORIGIN b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. ; IPv6 reverse
@ NS @ ; Use origin
$ORIGIN 12345678901234567890123456789012345678901234567890123456789012\051.tld. ; Label of maximal length
@ NS @ ; Use origin
$ORIGIN 123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.1234567890123456789012345678901234567890123456789012345678901. ; Domain name of maximal length
@ NS @ ; Use origin
$origin . ; Lower-case
@ NS @ ; Use origin
; KO
$ORIGIN ; Empty input
. NS . ; Is OK, but shouldn't be processed due to previous error stop!
OWNER=00
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=00
------
OWNER=016100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=00
------
OWNER=016100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=00
------
OWNER=03746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=03746C6400
------
OWNER=016100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=03746C6400
------
OWNER=016103746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=03746C6400
------
OWNER=067365636f6e6403746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=067365636F6E6403746C6400
------
OWNER=016100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=067365636F6E6403746C6400
------
OWNER=0161067365636f6e6403746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=067365636F6E6403746C6400
------
OWNER=082030205c222e402a03746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=082030205C222E402A03746C6400
------
OWNER=0162016101390138013701360135013001300130013001300130013001300130013001300130013001300130013001300138016201640130013101300130013203697036046172706100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=0162016101390138013701360135013001300130013001300130013001300130013001300130013001300130013001300138016201640130013101300130013203697036046172706100
------
OWNER=3f31323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323303746c6400
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=3F31323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323303746C6400
------
OWNER=3f3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333f3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333f3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333d3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303100
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=3F3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333F3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333F3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333D3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303100
------
OWNER=00
CLASS=0001
RRTTL=00000001
RTYPE=0002
RDATA=00
------
ERROR=ZSCANNER_EBAD_ORIGIN
------
$TTL 1
; KO
$ORIGIN tld ; Not FQD
ERROR=ZSCANNER_EBAD_ORIGIN
------
$TTL 1
; KO
$ORIGIN % ; Bad (unslashed) character
ERROR=ZSCANNER_EBAD_ORIGIN
------
$TTL 1
; KO
$ORIGIN .. ; Missing label between dots
ERROR=ZSCANNER_EBAD_REST
------
$TTL 1
; KO
$ORIGIN \1 ; Slash notation requires 3 digits
ERROR=ZSCANNER_EBAD_NUMBER
------
$TTL 1
; KO
$ORIGIN \12 ; Slash notation requires 3 digits
ERROR=ZSCANNER_EBAD_NUMBER
------
$TTL 1
; KO
$ORIGIN .tld ; Leading dot
ERROR=ZSCANNER_EBAD_REST
------
$TTL 1
; KO
$ORIGIN tld. x ; Unexpected item
ERROR=ZSCANNER_EBAD_REST
------
$TTL 1
; KO
$ORIGIN 12345678901234567890123456789012345678901234567890123456789012\0514.tld. ; Label exceeded maximal length
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment