]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py
0d4e52d78e4bdb11b91c0e52c3f74f6a0a944a6c
[thirdparty/pdns.git] / regression-tests.nobackend / negcache-tests-dotted-cname / pipe.py
1 #!/usr/bin/env python2.7 -u
2
3 import sys
4
5 line = sys.stdin.readline()
6 # TOLO
7 print('OK\tTest backend firing up')
8
9 while True:
10 line = sys.stdin.readline()
11 items = line.split('\t')
12 sys.stderr.write(line)
13 if len(items) < 6:
14 print('LOG\tGot an unparseable line')
15 print('LOG\t%s' % line)
16 print('END')
17 continue
18
19 what, qname, qclass, qtype, id, ip = items
20
21 if qtype in ['SOA', 'ANY'] and qname == 'example2.com':
22 print('DATA\t%s\t%s\tSOA\t300\t-1\tns1.example.com ahu.example.com 2008080300 1800 3600 604800 3600' % (qname, qclass))
23
24 if qtype in ['NS', 'ANY'] and qname == 'example2.com':
25 print('DATA\t%s\t%s\tNS\t3600\t-1\tns1.example.com' % (qname, qclass))
26 print('DATA\t%s\t%s\tNS\t3600\t-1\tns2.example.com' % (qname, qclass))
27
28 if qtype in ['A', 'ANY'] and qname.endswith('example2.com'):
29 # We were asked a specific record
30 print('DATA\t%s\t%s\tCNAME\t3600\t-1\twww.example.com.' % (qname, qclass))
31
32 print('END')