From: Karel Slany Date: Thu, 4 Jun 2015 14:49:30 +0000 (+0200) Subject: tests: converting algorithm identifier to number in DS records in .rpl X-Git-Tag: v1.0.0-beta1~126^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c8fedf33980140bccc116f8e63bcf1b848429cd;p=thirdparty%2Fknot-resolver.git tests: converting algorithm identifier to number in DS records in .rpl The parsing of *.rpl files failed on reading DS records because the algorithm identifier is a string rather than a number. --- diff --git a/tests/pydnstest/scenario.py b/tests/pydnstest/scenario.py index cfb04e629..2a9d05749 100644 --- a/tests/pydnstest/scenario.py +++ b/tests/pydnstest/scenario.py @@ -1,6 +1,7 @@ import dns.message import dns.rrset import dns.rcode +import dns.dnssec class Entry: """ @@ -135,6 +136,9 @@ class Entry: rdtype = args.pop(0) rr = dns.rrset.from_text(owner, ttl, rdclass, rdtype) if len(args) > 0: + if (rr.rdtype == dns.rdatatype.DS): + # convert textual algorithm identifier to number + args[1] = str(dns.dnssec.algorithm_from_text(args[1])) rd = dns.rdata.from_text(rr.rdclass, rr.rdtype, ' '.join(args), origin=dns.name.from_text(self.origin), relativize=False) rr.add(rd) return rr