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

func-tests: extend ixfr test

parent a4b4193f
No related branches found
No related tags found
No related merge requests found
Showing
with 148 additions and 41 deletions
......@@ -15,4 +15,5 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Added new node with one rrset.
add1 A 1.2.3.4
\ No newline at end of file
......@@ -17,5 +17,6 @@ mail A 192.0.2.3
add1 A 1.2.3.4
; Added new node with two different rrsets.
add2 AAAA ::1
TXT "some text"
\ No newline at end of file
TXT "some_text"
\ No newline at end of file
......@@ -18,7 +18,8 @@ mail A 192.0.2.3
add1 A 1.2.3.4
add2 AAAA ::1
TXT "some text"
TXT "some_text"
; Added two nodes.
add3 AAAA ::2
add4 TXT "some text2"
\ No newline at end of file
add4 TXT "some_text2"
\ No newline at end of file
$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
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
add1 A 1.2.3.4
add2 AAAA ::1
TXT "some_text"
add3 AAAA ::2
add4 TXT "some_text2"
; Added new rrset to the existing node.
add3 A 1.1.1.1
; Added another record to the existing node.
add4 TXT "some_text3"
\ No newline at end of file
#!/usr/bin/env python3
'''Add record/records to zone file.'''
'''Add record/records.'''
def run(i):
i.test.start()
......@@ -10,6 +10,7 @@ def run(i):
i.check_rec("add2", "AAAA", rcode="NXDOMAIN")
i.check_rec("add2", "TXT", rcode="NXDOMAIN")
i.check_rec("add3", "AAAA", rcode="NXDOMAIN")
i.check_rec("add3", "A", rcode="NXDOMAIN")
i.check_rec("add4", "TXT", rcode="NXDOMAIN")
i.check(1)
......@@ -17,10 +18,16 @@ def run(i):
i.check(2)
i.check_rec("add2", "AAAA", "::1")
i.check_rec("add2", "TXT", "some text")
i.check_rec("add2", "TXT", "some_text")
i.check(3)
i.check_rec("add3", "AAAA", "::2")
i.check_rec("add4", "TXT", "some text2")
i.check_rec("add4", "TXT", "some_text2")
i.check(4)
i.check_rec("add3", "AAAA", "::2")
i.check_rec("add3", "A", "1.1.1.1")
i.check_rec("add4", "TXT", "some_text2")
i.check_rec("add4", "TXT", "some_text3")
i.test.end()
......@@ -7,7 +7,7 @@ $TTL 3600
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
......@@ -18,7 +18,7 @@ mail A 192.0.2.3
rem1 A 1.2.3.4
rem2 AAAA ::1
TXT "some text"
TXT "some_text"
rem3 AAAA ::2
rem4 TXT "some text2"
\ No newline at end of file
rem4 TXT "some_text2"
\ No newline at end of file
......@@ -7,7 +7,7 @@ $TTL 3600
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
......@@ -15,8 +15,10 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Removed one node with one rrset.
rem2 AAAA ::1
TXT "some text"
TXT "some_text"
rem3 AAAA ::2
rem4 TXT "some text2"
rem4 TXT "some_text2"
......@@ -7,7 +7,7 @@ $TTL 3600
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
A 1.1.1.1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
......@@ -15,5 +15,7 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Removed one node with two rrsets.
rem3 AAAA ::2
rem4 TXT "some text2"
\ No newline at end of file
rem4 TXT "some_text2"
\ No newline at end of file
......@@ -7,10 +7,12 @@ $TTL 3600
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::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
; Removed two nodes.
\ No newline at end of file
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111207 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
; Removed record from rrset.
dns2 A 192.0.2.2
; Removed rrset.
mail A 192.0.2.3
AAAA 2001:DB8::3
#!/usr/bin/env python3
'''Remove record/records from the zone file.'''
'''Remove record/records.'''
def run(i):
i.test.start()
i.check()
i.check_rec("dns1", "A", "192.0.2.1")
i.check_rec("dns1", "A", "1.1.1.1")
i.check_rec("dns2", "A", "192.0.2.2")
i.check_rec("dns2", "AAAA", "2001:DB8::2")
i.check_rec("rem1", "A", "1.2.3.4")
i.check_rec("rem2", "AAAA", "::1")
i.check_rec("rem2", "TXT", "some text")
i.check_rec("rem2", "TXT", "some_text")
i.check_rec("rem3", "AAAA", "::2")
i.check_rec("rem4", "TXT", "some text2")
i.check_rec("rem4", "TXT", "some_text2")
i.check(1)
i.check_rec("rem1", "A", rcode="NXDOMAIN")
i.check(2)
i.check_rec("rem1", "A", rcode="NXDOMAIN")
i.check_rec("rem2", "AAAA", rcode="NXDOMAIN")
i.check_rec("rem2", "TXT", rcode="NXDOMAIN")
i.check(3)
i.check_rec("rem1", "A", rcode="NXDOMAIN")
i.check_rec("rem2", "AAAA", rcode="NXDOMAIN")
i.check_rec("rem2", "TXT", rcode="NXDOMAIN")
i.check_rec("rem3", "AAAA", rcode="NXDOMAIN")
i.check_rec("rem4", "TXT", rcode="NXDOMAIN")
i.check(4)
i.check_rec("dns1", "A", "192.0.2.1")
i.check_rec("dns1", "A", nordata="1.1.1.1")
i.check_rec("dns2", "A", "192.0.2.2")
i.check_rec("dns2", "AAAA", nordata="2001:DB8::2")
i.test.end()
......@@ -18,7 +18,7 @@ mail A 192.0.2.3
rem1 A 1.2.3.4
rem2 AAAA ::1
TXT "some text"
TXT "some_text"
rem3 AAAA ::2
rem4 TXT "some text2"
\ No newline at end of file
rem4 TXT "some_text2"
\ No newline at end of file
......@@ -15,10 +15,13 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Removed node with one rrset.
rem2 AAAA ::1
TXT "some text"
TXT "some_text"
rem3 AAAA ::2
rem4 TXT "some text2"
rem4 TXT "some_text2"
; Added new node one rrset.
add1 A 1.2.3.4
\ No newline at end of file
......@@ -15,10 +15,13 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Removed node with two rrsets.
rem3 AAAA ::2
rem4 TXT "some text2"
rem4 TXT "some_text2"
add1 A 1.2.3.4
; Added new node with two rrsets.
add2 AAAA ::1
TXT "some text"
TXT "some_text"
......@@ -15,10 +15,13 @@ dns2 A 192.0.2.2
mail A 192.0.2.3
AAAA 2001:DB8::3
; Removed two nodes.
add1 A 1.2.3.4
add2 AAAA ::1
TXT "some text"
TXT "some_text"
; Added two new nodes.
add3 AAAA ::2
add4 TXT "some text2"
add4 TXT "some_text2"
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111207 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
add1 A 1.2.3.4
add2 AAAA ::1
TXT "some_text"
add3 AAAA ::2
add4 TXT "some_text2"
; Reappeared node with a previous rrset.
rem4 TXT "some_text2"
\ No newline at end of file
#!/usr/bin/env python3
'''Add and remove record/records from the zone file.'''
'''Add and remove record/records.'''
def run(i):
i.test.start()
......@@ -8,9 +8,9 @@ def run(i):
i.check()
i.check_rec("rem1", "A", "1.2.3.4")
i.check_rec("rem2", "AAAA", "::1")
i.check_rec("rem2", "TXT", "some text")
i.check_rec("rem2", "TXT", "some_text")
i.check_rec("rem3", "AAAA", "::2")
i.check_rec("rem4", "TXT", "some text2")
i.check_rec("rem4", "TXT", "some_text2")
i.check(1)
i.check_rec("rem1", "A", rcode="NXDOMAIN")
......@@ -20,12 +20,15 @@ def run(i):
i.check_rec("rem2", "AAAA", rcode="NXDOMAIN")
i.check_rec("rem2", "TXT", rcode="NXDOMAIN")
i.check_rec("add2", "AAAA", "::1")
i.check_rec("add2", "TXT", "some text")
i.check_rec("add2", "TXT", "some_text")
i.check(3)
i.check_rec("rem3", "AAAA", rcode="NXDOMAIN")
i.check_rec("rem4", "TXT", rcode="NXDOMAIN")
i.check_rec("add3", "AAAA", "::2")
i.check_rec("add4", "TXT", "some text2")
i.check_rec("add4", "TXT", "some_text2")
i.check(4)
i.check_rec("rem4", "TXT", "some_text2")
i.test.end()
......@@ -44,7 +44,7 @@ class IxfrTopology():
def check(self, version=None):
'''Check ixfr between all nodes.'''
check_log("CHECK IXFR TOPOLOGY")
check_log("CHECK IXFR TOPOLOGY %s" % version)
# Set zone file version if specified.
if version:
......@@ -71,7 +71,8 @@ class IxfrTopology():
check_log("====================================")
def check_rec(self, rname, rtype, rdata=None, rcode="NOERROR"):
def check_rec(self, rname, rtype, rdata=None, nordata=None,
rcode="NOERROR"):
'''Ask all nodes for the given record.'''
check_log("CHECK IXFR RECORD")
......@@ -82,19 +83,19 @@ class IxfrTopology():
check_log("%s:" % self.master.name)
resp = self.master.dig(rname, rtype)
resp.check(rdata=rdata, rcode=rcode)
resp.check(rdata=rdata, nordata=nordata, rcode=rcode)
check_log("%s:" % self.slave1.name)
resp = self.slave1.dig(rname, rtype)
resp.check(rdata=rdata, rcode=rcode)
resp.check(rdata=rdata, nordata=nordata, rcode=rcode)
check_log("%s:" % self.slave2.name)
resp = self.slave2.dig(rname, rtype)
resp.check(rdata=rdata, rcode=rcode)
resp.check(rdata=rdata, nordata=nordata, rcode=rcode)
check_log("%s:" % self.ref_slave.name)
resp = self.ref_slave.dig(rname, rtype)
resp.check(rdata=rdata, rcode=rcode)
resp.check(rdata=rdata, nordata=nordata, rcode=rcode)
check_log("====================================")
......
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