Skip to content
Snippets Groups Projects
Commit 33d01c4c authored by Daniel Salzman's avatar Daniel Salzman
Browse files

func-tests: add ixfr scenarios

parent 6b5fac3d
No related branches found
No related tags found
No related merge requests found
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111203 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
ch1 A 1.2.3.4
ch2 AAAA ::1
TXT "some_text"
ch3 MX 10 ch1.example.com.
MX 20 ch2.example.com.
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111204 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Changed rdata in one record rrset.
ch1 A 1.1.1.1
ch2 AAAA ::1
TXT "some_text"
ch3 MX 10 ch1.example.com.
MX 20 ch2.example.com.
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111205 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
ch1 A 1.1.1.1
; Changed rdata in two rrsets node.
ch2 AAAA ::1
TXT "some_better_text"
ch3 MX 10 ch1.example.com.
MX 20 ch2.example.com.
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111206 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
ch1 A 1.1.1.1
ch2 AAAA ::1
TXT "some_better_text"
; Changed rdata in two record rrset.
ch3 MX 10 mail.example.com.
MX 40 ch2.example.com.
#!/usr/bin/env python3
'''Change record/records.'''
def run(i):
i.test.start()
i.check()
i.check_rec("ch1", "A", "1.2.3.4")
i.check_rec("ch2", "AAAA", "::1")
i.check_rec("ch2", "TXT", "some_text")
i.check_rec("ch3", "MX", "10 ch1.example.com.")
i.check_rec("ch3", "MX", "20 ch2.example.com.")
i.check(1)
i.check_rec("ch1", "A", nordata="1.2.3.4")
i.check_rec("ch1", "A", "1.1.1.1")
i.check(2)
i.check_rec("ch2", "AAAA", "::1")
i.check_rec("ch2", "TXT", nordata="some_text")
i.check_rec("ch2", "TXT", "some_better_text")
i.check(3)
i.check_rec("ch3", "MX", nordata="10 ch1.example.com.")
i.check_rec("ch3", "MX", "10 mail.example.com.")
i.check_rec("ch3", "MX", nordata="20 ch2.example.com.")
i.check_rec("ch3", "MX", "40 ch2.example.com.")
i.test.end()
......@@ -76,13 +76,13 @@ class Response(object):
if rdata:
# We work with just one rdata with TTL=0 (this TTL is not used).
rrset = dns.rdataset.from_text(self.rclass, self.rtype, 0, rdata)
ref = list(rrset)[0]
ref = str(list(rrset)[0])
# Check answer section if contains reference rdata.
for data in self.resp.answer:
for rdata in data.to_rdataset():
for rd in data.to_rdataset():
# Compare Rdataset instances.
if rdata == ref:
if str(rd) == ref:
# Check CLASS.
compare(data.rdclass, self.rclass, "CLASS")
# Check TYPE.
......@@ -101,13 +101,13 @@ class Response(object):
if nordata:
# We work with just one rdata with TTL=0 (this TTL is not used).
rrset = dns.rdataset.from_text(self.rclass, self.rtype, 0, nordata)
ref = list(rrset)[0]
ref = str(list(rrset)[0])
# Check answer section if contains reference rdata.
for data in self.resp.answer:
for rdata in data.to_rdataset():
for rd in data.to_rdataset():
# Compare Rdataset instances.
if rdata == ref:
if str(rd) == ref:
set_err("CHECK RDATA")
check_log("ERROR: CHECK RDATA")
detail_log("!Unwanted data in ANSWER section:")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment