Skip to content
Snippets Groups Projects
Commit f5831db1 authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Merge branch 'master' into ttl-check-fix

parents 7796e635 fab123c2
No related branches found
No related tags found
No related merge requests found
......@@ -762,6 +762,7 @@ static int remove_invalid_dnskeys(const knot_rrset_t *soa,
uint16_t dnskeys_rdata_count = dnskeys->rrs.rr_count;
for (uint16_t i = 0; i < dnskeys_rdata_count; i++) {
dnskeys_data = knot_rdataset_at(&dnskeys->rrs, i);
uint8_t *rdata = knot_rdata_data(dnskeys_data);
uint16_t rdata_size = knot_rdata_rdlen(dnskeys_data);
uint16_t keytag = knot_keytag(rdata, rdata_size);
......
......@@ -3,7 +3,6 @@
'''Test for server identification over CH/TXT'''
from dnstest.test import Test
import socket
t = Test()
......@@ -25,7 +24,7 @@ resp.check('"' + name + '"')
# 2) FQDN hostname.
resp = server2.dig("id.server", "TXT", "CH")
resp.check(socket.gethostname())
resp.check(t.hostname)
# 3) Explicitly disabled.
resp = server3.dig("id.server", "TXT", "CH")
......
......@@ -3,7 +3,6 @@
'''Test for EDNS0/NSID identification'''
from dnstest.test import Test
import socket
t = Test()
......@@ -30,7 +29,7 @@ resp.check_edns(nsid=name)
# 2) FQDN hostname.
resp = server2.dig("example.com", "SOA", nsid=True)
resp.check_edns(nsid=socket.gethostname())
resp.check_edns(nsid=t.hostname)
# 3) Explicitly disabled.
resp = server3.dig("example.com", "SOA", nsid=True)
......
......@@ -88,6 +88,13 @@ class Test(object):
Test.last_port = port
return port
@property
def hostname(self):
hostname = socket.gethostname()
addrinfo = socket.getaddrinfo(hostname, 0, socket.AF_UNSPEC,
socket.SOCK_DGRAM, 0, socket.AI_CANONNAME)
return addrinfo[0][3] if addrinfo else hostname
def server(self, server, nsid=None, ident=None, version=None, \
valgrind=None):
if server == "knot":
......
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