]>
git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/test_Expired.py
8 from recursortests
import RecursorTest
11 class testExpired(RecursorTest
):
12 """This regression test starts the authoritative servers with a clock that is
13 set 15 days into the past. Hence, the recursor must reject the signatures
14 because they are expired.
18 _config_template
= """dnssec=validate"""
20 _auth_env
= {'LD_PRELOAD':os
.environ
.get('LIBFAKETIME'),
24 query
= dns
.message
.make_query('host1.secure.example', 'A')
25 res
= self
.sendUDPQuery(query
)
27 self
.assertRcodeEqual(res
, dns
.rcode
.SERVFAIL
)
29 class testExpiredWithEDE(RecursorTest
):
30 """This regression test starts the authoritative servers with a clock that is
31 set 15 days into the past. Hence, the recursor must reject the signatures
32 because they are expired.
34 _confdir
= 'ExpiredWithEDE'
36 _config_template
= """
38 extended-resolution-errors=yes
41 _auth_env
= {'LD_PRELOAD':os
.environ
.get('LIBFAKETIME'),
45 qname
= 'host1.secure.example'
46 query
= dns
.message
.make_query(qname
, 'A', want_dnssec
=True)
48 for method
in ("sendUDPQuery", "sendTCPQuery"):
49 sender
= getattr(self
, method
)
50 res
= sender(query
, timeout
=5.0)
51 self
.assertRcodeEqual(res
, dns
.rcode
.SERVFAIL
)
52 self
.assertEqual(res
.edns
, 0)
53 self
.assertEqual(len(res
.options
), 1)
54 self
.assertEqual(res
.options
[0].otype
, 15)
55 self
.assertEqual(res
.options
[0], extendederrors
.ExtendedErrorOption(7, b
''))