-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from farsightsec/tests-202309
Add tests for base:dns, dnsqr, and dnsobs, update base:dnstap tests
- Loading branch information
Showing
24 changed files
with
956 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/sh | ||
|
||
status=0 | ||
|
||
check() { | ||
if [ $? = "0" ]; then | ||
echo "PASS: $*" | ||
else | ||
echo "FAIL: $*" | ||
status=1 | ||
fi | ||
} | ||
|
||
NMSG_MSGMOD_DIR="@abs_top_builddir@/nmsg/base/.libs" | ||
export NMSG_MSGMOD_DIR | ||
NMSGTOOL="@abs_top_builddir@/src/nmsgtool" | ||
|
||
SOURCE=@abs_top_srcdir@/tests/nmsg-dns-tests/test1-dns | ||
OUTPUT=@abs_top_builddir@/tests/nmsg-dns-tests/test1-dns | ||
|
||
# cleanup from previous run | ||
rm -f ${OUTPUT}*out | ||
|
||
$NMSGTOOL -r ${SOURCE}.nmsg > ${OUTPUT}.nmsg.pres.out | ||
check read nmsg base:dns and create presentation output | ||
cmp -s ${SOURCE}.pres ${OUTPUT}.nmsg.pres.out | ||
check nmsg-to-presentation | ||
|
||
$NMSGTOOL -r ${SOURCE}.nmsg -J ${OUTPUT}.nmsg.json.out | ||
check read nmsg base:dns and create json output | ||
cmp -s ${SOURCE}.json ${OUTPUT}.nmsg.json.out | ||
check nmsg-to-json | ||
|
||
# output should be same as input | ||
$NMSGTOOL -r ${SOURCE}.nmsg -w ${OUTPUT}.nmsg.nmsg.out | ||
check read nmsg base:dns and create nmsg output | ||
cmp -s ${SOURCE}.nmsg ${OUTPUT}.nmsg.nmsg.out | ||
check nmsg-to-nmsg | ||
|
||
$NMSGTOOL -j ${SOURCE}.json > ${OUTPUT}.json.pres.out | ||
check read json base:dns and create presentation output | ||
cmp -s ${SOURCE}.pres ${OUTPUT}.json.pres.out | ||
check json-to-presentation | ||
|
||
# output should be same as input | ||
$NMSGTOOL -j ${SOURCE}.json -J ${OUTPUT}.json.json.out | ||
check read json base:dns and create json output | ||
cmp -s ${SOURCE}.json ${OUTPUT}.json.json.out | ||
check json-to-json | ||
|
||
$NMSGTOOL -j ${SOURCE}.json -w ${OUTPUT}.json.nmsg.out | ||
check read json base:dns and create nmsg output | ||
cmp -s ${SOURCE}.nmsg ${OUTPUT}.json.nmsg.out | ||
check json-to-nmsg | ||
|
||
# another test input | ||
# TODO: use a function since is repeated | ||
|
||
$NMSGTOOL -r @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.nmsg > @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.nmsg.pres.out | ||
check read nmsg base:dns and create presentation output | ||
cmp -s @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.pres @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.nmsg.pres.out | ||
check nmsg-to-presentation | ||
|
||
$NMSGTOOL -r @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.nmsg -J @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.nmsg.json.out | ||
check read nmsg base:dns and create json output | ||
cmp -s @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.json @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.nmsg.json.out | ||
check nmsg-to-json | ||
|
||
$NMSGTOOL -j @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.json > @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.json.pres.out | ||
check read json base:dns and create presentation output | ||
cmp -s @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.pres @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.json.pres.out | ||
check json-to-presentation | ||
|
||
$NMSGTOOL -j @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.json -J @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.json.json.out | ||
check read json base:dns and create json output | ||
cmp -s @abs_top_srcdir@/tests/nmsg-dns-tests/test2-dns.json @abs_top_builddir@/tests/nmsg-dns-tests/test2-dns.json.json.out | ||
check json-to-json | ||
|
||
# NOTE: --readpres is not fully implemented for base:dns so aborts | ||
|
||
# JSON input mistakes should result in no output | ||
$NMSGTOOL -dd -j @abs_top_srcdir@/tests/nmsg-dns-tests/test3-dns.json --writepres @abs_top_builddir@/tests/nmsg-dns-tests/test3-dns.json.pres.out 2>@abs_top_builddir@/tests/nmsg-dns-tests/test3-dns.json.pres.stderr.out | ||
check read broken json base:dns and create empty output | ||
grep "JSON parse error:" @abs_top_builddir@/tests/nmsg-dns-tests/test3-dns.json.pres.stderr.out >/dev/null | ||
check reports JSON parse error | ||
test ! -s @abs_top_builddir@/tests/nmsg-dns-tests/test3-dns.json.pres.out | ||
check broken-json-to-empty-pres | ||
|
||
exit $status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"time":"2011-02-09 19:41:52.068575000","vname":"base","mname":"dns","message":{"rrname":"test1.example.net.","rrclass":"IN","rrtype":"TXT","rrttl":3600,"rdata":["\"Hello\""]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"qname":"test1.example.net.","qclass":"IN","qtype":"A","section":1,"rrname":"test1.example.net.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["10.11.12.13","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"test1.example.net.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["10.11.12.13","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"test1.example.net.","rrclass":"IN","rrtype":"SPF","rrttl":172800,"rdata":["\"10.11.12.13\"","\"10.12.13.14\""]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"qname":"test1.example.net.","qclass":"IN","qtype":"A","rrname":"test1.example.net.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["10.11.12.13"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"test1.example.net.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["10.11.12.13"]}} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[36] [2011-02-09 19:41:52.068575000] [1:7 base dns] [00000000] [] [] | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: TXT (16) | ||
rrttl: 3600 | ||
rdata: "Hello" | ||
|
||
[68] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
qname: test1.example.net. | ||
qclass: IN (1) | ||
qtype: A (1) | ||
section: 1 | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: A (1) | ||
rrttl: 172800 | ||
rdata: 10.11.12.13 | ||
rdata: 10.12.13.14 | ||
|
||
[41] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: A (1) | ||
rrttl: 172800 | ||
rdata: 10.11.12.13 | ||
rdata: 10.12.13.14 | ||
|
||
[57] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: SPF (99) | ||
rrttl: 172800 | ||
rdata: "10.11.12.13" | ||
rdata: "10.12.13.14" | ||
|
||
[60] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
qname: test1.example.net. | ||
qclass: IN (1) | ||
qtype: A (1) | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: A (1) | ||
rrttl: 172800 | ||
rdata: 10.11.12.13 | ||
|
||
[35] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: test1.example.net. | ||
rrclass: IN (1) | ||
rrtype: A (1) | ||
rrttl: 172800 | ||
rdata: 10.11.12.13 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":".","rrclass":"IN","rrtype":"SOA","rrttl":86400,"rdata":["a.root-servers.net. nstld.verisign-grs.com. 2018110200 1800 900 604800 86400"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":".","rrclass":"IN","rrtype":"RRSIG","rrttl":86400,"rdata":["SOA 8 0 86400 1542258000 1541131200 2134 . YzIh/SUfJITb8q0y45FtmHYU2q3ozTWzFoFTVMGEQmKkVIxvASHxKJAtkQQbA1OUkwsoXZAKFPwPLLdBn7YsesIlMosEfVtLIZe8iNivbzTTp0R81QK4bZfXqRbsIzl9h0YNxbprrvz7rhrIa1QkKg8Eiz2pI12ero8bjSBlOt+vGlnxOriI7WfjtGNTZ5kzwfRcpbND5i0PZkfSPyL6mrOgI6Ak+F7jGos+4H86OPpikmOwKXOC50qs6ayX4YHMQgtdOXe7YMxzAEUUWR7aCg379dbwjRDrt3HhpLIlvxNzOqOQhCCBT0uez08+MEiJQ+g/9oDexqb9vPsZHTf8VQ=="]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":".","rrclass":"IN","rrtype":"NS","rrttl":518400,"rdata":["a.root-servers.net.","b.root-servers.net.","c.root-servers.net.","d.root-servers.net.","e.root-servers.net.","f.root-servers.net.","g.root-servers.net.","h.root-servers.net.","i.root-servers.net.","j.root-servers.net.","k.root-servers.net.","l.root-servers.net.","m.root-servers.net."]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":".","rrclass":"IN","rrtype":"NSEC","rrttl":86400,"rdata":["aaa. NS SOA RRSIG NSEC DNSKEY"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":".","rrclass":"IN","rrtype":"DNSKEY","rrttl":172800,"rdata":["256 3 8 AwEAAdp440E6Mz7c+Vl4sPd0lTv2Qnc85dTW64j0RDD7sS/zwxWDJ3QRES2VKDO0OXLMqVJSs2YCCSDKuZXpDPuf++YfAu0j7lzYYdWTGwyNZhEaXtMQJIKYB96pW6cRkiG2Dn8S2vvo/PxW9PKQsyLbtd8PcwWglHgReBVp7kEv/Dd+3b3YMukt4jnWgDUddAySg558Zld+c9eGWkgWoOiuhg4rQRkFstMX1pRyOSHcZuH38o1WcsT4y3eT0U/SR6TOSLIB/8Ftirux/h297oS7tCcwSPt0wwry5OFNTlfMo8v7WGurogfk8hPipf7TTKHIi20LWen5RCsvYsQBkYGpF78=","257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=","257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU="]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"ns1.dns.nic.aaa.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["156.154.144.2"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"ns1.dns.nic.aaa.","rrclass":"IN","rrtype":"AAAA","rrttl":172800,"rdata":["2610:a1:1071::2"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"ac.","rrclass":"IN","rrtype":"DS","rrttl":86400,"rdata":["42665 8 1 D5E99D85351D361BD6B5B1582F634E8A85CF1BF7","23014 8 2 9F135B4B4C69C92383B997632E821E3C8AB9699658674CC96FDE5405ACB68B65","42665 8 2 4B15F405C98F4BC3A370B19E54DBE75DF201EDCD38577C51D277DC6559865D95"]}} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[77] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: . | ||
rrclass: IN (1) | ||
rrtype: SOA (6) | ||
rrttl: 86400 | ||
rdata: a.root-servers.net. nstld.verisign-grs.com. 2018110200 1800 900 604800 86400 | ||
|
||
[289] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: . | ||
rrclass: IN (1) | ||
rrtype: RRSIG (46) | ||
rrttl: 86400 | ||
rdata: SOA 8 0 86400 1542258000 1541131200 2134 . YzIh/SUfJITb8q0y45FtmHYU2q3ozTWzFoFTVMGEQmKkVIxvASHxKJAtkQQbA1OUkwsoXZAKFPwPLLdBn7YsesIlMosEfVtLIZe8iNivbzTTp0R81QK4bZfXqRbsIzl9h0YNxbprrvz7rhrIa1QkKg8Eiz2pI12ero8bjSBlOt+vGlnxOriI7WfjtGNTZ5kzwfRcpbND5i0PZkfSPyL6mrOgI6Ak+F7jGos+4H86OPpikmOwKXOC50qs6ayX4YHMQgtdOXe7YMxzAEUUWR7aCg379dbwjRDrt3HhpLIlvxNzOqOQhCCBT0uez08+MEiJQ+g/9oDexqb9vPsZHTf8VQ== | ||
|
||
[297] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: . | ||
rrclass: IN (1) | ||
rrtype: NS (2) | ||
rrttl: 518400 | ||
rdata: a.root-servers.net. | ||
rdata: b.root-servers.net. | ||
rdata: c.root-servers.net. | ||
rdata: d.root-servers.net. | ||
rdata: e.root-servers.net. | ||
rdata: f.root-servers.net. | ||
rdata: g.root-servers.net. | ||
rdata: h.root-servers.net. | ||
rdata: i.root-servers.net. | ||
rdata: j.root-servers.net. | ||
rdata: k.root-servers.net. | ||
rdata: l.root-servers.net. | ||
rdata: m.root-servers.net. | ||
|
||
[27] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: . | ||
rrclass: IN (1) | ||
rrtype: NSEC (47) | ||
rrttl: 86400 | ||
rdata: aaa. NS SOA RRSIG NSEC DNSKEY | ||
|
||
[812] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: . | ||
rrclass: IN (1) | ||
rrtype: DNSKEY (48) | ||
rrttl: 172800 | ||
rdata: 256 3 8 AwEAAdp440E6Mz7c+Vl4sPd0lTv2Qnc85dTW64j0RDD7sS/zwxWDJ3QRES2VKDO0OXLMqVJSs2YCCSDKuZXpDPuf++YfAu0j7lzYYdWTGwyNZhEaXtMQJIKYB96pW6cRkiG2Dn8S2vvo/PxW9PKQsyLbtd8PcwWglHgReBVp7kEv/Dd+3b3YMukt4jnWgDUddAySg558Zld+c9eGWkgWoOiuhg4rQRkFstMX1pRyOSHcZuH38o1WcsT4y3eT0U/SR6TOSLIB/8Ftirux/h297oS7tCcwSPt0wwry5OFNTlfMo8v7WGurogfk8hPipf7TTKHIi20LWen5RCsvYsQBkYGpF78= | ||
rdata: 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0= | ||
rdata: 257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU= | ||
|
||
[33] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: ns1.dns.nic.aaa. | ||
rrclass: IN (1) | ||
rrtype: A (1) | ||
rrttl: 172800 | ||
rdata: 156.154.144.2 | ||
|
||
[45] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: ns1.dns.nic.aaa. | ||
rrclass: IN (1) | ||
rrtype: AAAA (28) | ||
rrttl: 172800 | ||
rdata: 2610:a1:1071::2 | ||
|
||
[116] [2018-11-07 16:50:54.000000000] [1:7 base dns] [00000000] [] [] | ||
rrname: ac. | ||
rrclass: IN (1) | ||
rrtype: DS (43) | ||
rrttl: 86400 | ||
rdata: 42665 8 1 D5E99D85351D361BD6B5B1582F634E8A85CF1BF7 | ||
rdata: 23014 8 2 9F135B4B4C69C92383B997632E821E3C8AB9699658674CC96FDE5405ACB68B65 | ||
rdata: 42665 8 2 4B15F405C98F4BC3A370B19E54DBE75DF201EDCD38577C51D277DC6559865D95 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"garbage-rrtype.test3.example.net.","rrclass":"IN","rrtype":"garbage","rrttl":172800,"rdata":["10.11.12.13","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"type99.test3.example.net.","rrclass":"IN","rrtype":"TYPE999","rrttl":172800,"rdata":["10.11.12.13","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"unknown-rrtype.test3.example.net.","rrclass":"IN","rrtype":"<UNKNOWN>","rrttl":172800,"rdata":["10.11.12.13","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"garbage-rdata.test3.example.net.","rrclass":"IN","rrtype":"A","rrttl":172800,"rdata":["not an IP address","10.12.13.14"]}} | ||
{"time":"2018-11-07 16:50:54.000000000","vname":"base","mname":"dns","message":{"rrname":"garbage-rrttl.test3.example.net.","rrclass":"IN","rrtype":"A","rrttl":"not an TTL number","rdata":["10.11.12.13","10.12.13.14"]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/sh | ||
|
||
status=0 | ||
|
||
check() { | ||
if [ $? = "0" ]; then | ||
echo "PASS: $*" | ||
else | ||
echo "FAIL: $*" | ||
status=1 | ||
fi | ||
} | ||
|
||
NMSG_MSGMOD_DIR="@abs_top_builddir@/nmsg/base/.libs" | ||
export NMSG_MSGMOD_DIR | ||
NMSGTOOL="@abs_top_builddir@/src/nmsgtool" | ||
PAYLOAD="@abs_top_srcdir@/tests/nmsg-dnsobs-tests/test-dnsobs.nmsg" | ||
|
||
SOURCE=@abs_top_srcdir@/tests/nmsg-dnsobs-tests/test1-dnsobs | ||
OUTPUT=@abs_top_builddir@/tests/nmsg-dnsobs-tests/test1-dnsobs | ||
|
||
# cleanup from previous run | ||
rm -f ${OUTPUT}*out | ||
|
||
$NMSGTOOL -r ${SOURCE}.nmsg > ${OUTPUT}.nmsg.pres.out | ||
check read nmsg base:dnsobs and create dnsobs presentation output | ||
cmp -s ${SOURCE}.pres ${OUTPUT}.nmsg.pres.out | ||
check nmsg-to-presentation | ||
|
||
# output should be same as input | ||
$NMSGTOOL -r ${SOURCE}.nmsg -w ${OUTPUT}.nmsg.nmsg.out | ||
check read nmsg base:dnsobs and create base:dnsobs nmsg output | ||
cmp -s ${SOURCE}.nmsg ${OUTPUT}.nmsg.nmsg.out | ||
check nmsg-to-nmsg | ||
|
||
$NMSGTOOL -r ${SOURCE}.nmsg -J ${OUTPUT}.nmsg.json.out | ||
check read nmsg base:dnsobs and create base:dnsobs json output | ||
cmp -s ${SOURCE}.json ${OUTPUT}.nmsg.json.out | ||
check nmsg-to-json | ||
|
||
$NMSGTOOL --readjson ${SOURCE}.json > ${OUTPUT}.json.pres.out | ||
check read json base:dnsobs and create dnsobs presentation output | ||
cmp -s ${SOURCE}.pres ${OUTPUT}.json.pres.out | ||
check json-to-presentation | ||
|
||
$NMSGTOOL --readjson ${SOURCE}.json -w ${OUTPUT}.json.nmsg.out | ||
check read json base:dnsobs and create base:dnsobs nmsg output | ||
cmp -s ${SOURCE}.nmsg ${OUTPUT}.json.nmsg.out | ||
check json-to-nmsg | ||
|
||
# output should be same as input | ||
$NMSGTOOL --readjson ${SOURCE}.json -J ${OUTPUT}.json.json.out | ||
check read json base:dnsobs and create base:dnsobs json output | ||
cmp -s ${SOURCE}.json ${OUTPUT}.json.json.out | ||
check json-to-json | ||
|
||
# NOTE: --readpres is not fully implemented for base:dnsobs | ||
|
||
exit $status |
Oops, something went wrong.