Commit 1dc7a54e authored by Ivana Krumlova's avatar Ivana Krumlova Committed by Petr Špaček

tools: scripts for sorting tests

dealing with signatures using dnspython,
symlink from deckard/tools to deckard/pydnstest to import modules
consistent output format
parent f992ad98
......@@ -25,7 +25,7 @@ for TEST in "$SOURCE/"*.rpl
do
if ! python3 parse.py "$TEST" >/dev/null 2>/dev/null
then
echo -e '\t' "$TEST"
echo -e '\t' $(basename "$TEST")
mv "$TEST" "$SOURCE/parsefail"
fi
done
......@@ -34,11 +34,11 @@ done
# Invalid DSA signatures (common in old testbound tests)
echo Invalid DSA signatures:
mkdir -p "$SOURCE/invaliddsa"
for TEST in "$SOURCE"/*.rpl
for TEST in "$SOURCE/"*.rpl
do
if ! python3 invalid_dsa.py "$TEST" >/dev/null 2>/dev/null
then
echo -e '\t' "$TEST"
echo -e '\t' $(basename "$TEST")
mv "$TEST" "$SOURCE/invaliddsa"
fi
done
......@@ -50,21 +50,21 @@ mkdir -p "$SOURCE/working"
for TEST in "$SOURCE/"*.rpl
do
PATH=$(readlink -m "$TEST")
if $TESTS="$PATH" ./../kresd_run.sh >/dev/null 2>/dev/null
if TESTS="$(readlink -m $TEST)" ./../kresd_run.sh >/dev/null 2>/dev/null
then
echo -e '\t' "$TEST"
echo -e '\t' $(basename "$TEST")
mv "$TEST" "$SOURCE/working"
fi
done
# Others
# Others TODO: sem nic nepadá a to je divný, asi chyba, neviem
echo Others:
mkdir -p "$SOURCE/others"
for test in "$SOURCE/*.rpl"
for TEST in "$SOURCE/"*.rpl
do
echo -e '\t' "$TEST"
echo -e '\t' $(basename "$TEST")
mv "$TEST" "$SOURCE/others"
done
......@@ -4,9 +4,8 @@
import os
import sys
import base64
import argparse
# sys.path.insert(0, '..')
import dns
import pydnstest
import pydnstest.scenario
import pydnstest.augwrap
......@@ -57,9 +56,11 @@ def check_rrsig(node, dsakeys):
for record in records:
if record["/type"].value == "RRSIG":
rrsig_data = record["/data"].value.split()
if rrsig_data[6] == key:
if len(base64.b64decode(rrsig_data[8])) != 41:
rrset = dns.rrset.from_text(record["/domain"].value, 300,
1, dns.rdatatype.RRSIG,
record["/data"].value)
if rrset.items[0].key_tag == int(key):
if len(rrset.items[0].signature) != 41:
return True
return False
......@@ -74,10 +75,8 @@ def main():
dsakeys = get_dsakeys(config, node)
bad_rrsig = check_rrsig(node, dsakeys)
if bad_rrsig:
print(1)
sys.exit(1)
else:
print(0)
sys.exit(0)
main()
......@@ -3,7 +3,6 @@
import sys
import os
import argparse
# sys.path.insert(0, '..')
import pydnstest
import pydnstest.scenario
......
/home/fitli/CZNIC/deckard/deckard/pydnstest/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment