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

func-test: refine project

parent edaf6de8
No related branches found
No related tags found
No related merge requests found
Showing
with 8 additions and 32 deletions
#!/usr/bin/env python3
'''Test for DDNS - add record'''
import dnstest
t = dnstest.DnsTest()
srv = t.server("knot")
zone = t.zone("example.com.")
t.link(zone, srv, ddns=True)
t.start()
update = srv.update(zone)
# Add one record.
update.add("test1.example.com.", 1234, "A", "1.2.3.4")
update.send()
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.end()
File moved
Prerequisites:
=============
Python >=3.3
python3-dnspython >=1.11.1
dnssec-keygen
......@@ -7,4 +7,5 @@ dnssec-signzone
Bind 9.9
lsof
Ubuntu - disable apparmor protection for system Bind:
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.named
\ No newline at end of file
......@@ -67,6 +67,12 @@ today = time.strftime("%Y-%m-%d", time.localtime(timestamp))
outs_dir = tempfile.mkdtemp(prefix="knottest-%s-" % timestamp)
params.debug = True if args.debug else False
# Set the current knot binaries if not specified.
if not os.environ.get("KNOT_TEST_KNOT"):
os.environ["KNOT_TEST_KNOT"] = current_dir + "/../../src/knotd"
if not os.environ.get("KNOT_TEST_KNOTC"):
os.environ["KNOT_TEST_KNOTC"] = current_dir + "/../../src/knotc"
# Set up logging.
log = logging.getLogger()
log.setLevel(logging.NOTSET)
......
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