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

func-test: partial ddns add test

parent 5de0f9a1
No related branches found
No related tags found
No related merge requests found
$ORIGIN .
$TTL 3601 ; 1 hour
example.com IN SOA dns1.example.com. hostmaster.example.com. (
2010111217 ; serial
21600 ; refresh (6 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS dns1.example.com.
NS dns2.example.com.
MX 10 mail.example.com.
$ORIGIN example.com.
12345 A 1.2.3.5
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
$TTL 3600
@ SOA dns1.example.com. hostmaster.example.com. (
2010111213 ; serial
6h ; refresh
1h ; retry
1w ; expire
1d ) ; minimum
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
#!/usr/bin/env python3
''' '''
'''Test for DDNS - add record'''
import dnstest
t = dnstest.DnsTest()
master = t.server("knot")
srv = t.server("bind")
zone = t.zone("example.com.", "example.com.zone")
t.link(zone, master, ddns=True)
t.link(zone, srv, ddns=True)
t.start()
update = master.update(zone)
update.add("t1.example.com.", 1234, "A", "1.2.3.4")
update.add("t2.example.com.", 1234, "A", "1.2.3.4")
update.add("t3.example.com.", 1234, "A", "1.2.3.4")
update = srv.update(zone)
# Add one record.
update.add("test1.example.com.", 1234, "A", "1.2.3.4")
update.send()
update.delete("t2.example.com.")
resp = srv.dig("test1.example.com.", "A")
resp.check("1.2.3.4", 1234)
# Add more records including glue record.
update.add("test2.example.com.", 1234, "NS", "test2.sub.example.com.")
update.add("test2.sub.example.com.", 2222, "A", "1.2.3.4")
update.send()
resp_a = srv.dig("test2.sub.example.com.", "A")
resp_a.check("1.2.3.4", 2222)
t.stop()
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