Commit 4690de01 authored by Daniel Salzman's avatar Daniel Salzman

tests-extra: improve wait for zone timeout

parent 5f07dce9
......@@ -24,9 +24,7 @@ for i in range(4):
# Update zone files on master.
for zone in zones:
master.update_zonefile(zone, random=True)
master.reload()
t.sleep(5)
# Wait for IXFR to slave.
serials = master.zones_wait(zones, serials_prev)
......
......@@ -24,9 +24,7 @@ for i in range(4):
# Update zone files on master.
for zone in zones:
master.update_zonefile(zone, random=True)
master.reload()
t.sleep(5)
# Wait for IXFR to slave.
serials = master.zones_wait(zones, serials_prev)
......
......@@ -24,9 +24,7 @@ for i in range(4):
# Update zone files on master.
for zone in zones:
master.update_zonefile(zone, random=True)
master.reload()
t.sleep(5)
# Wait for IXFR to slave.
serials = master.zones_wait(zones, serials_prev)
......
......@@ -24,8 +24,6 @@ for zone in zones:
master.reload()
t.sleep(30)
# Wait for IXFR to slave.
master.zones_wait(zones, serials_init)
slave.zones_wait(zones, serials_init)
......
......@@ -484,7 +484,10 @@ class Server(object):
if not log_no_sep:
detail_log(SEP)
return dnstest.response.Response(self, resp, args)
except dns.exception.Timeout:
pass
except:
time.sleep(timeout)
......@@ -515,20 +518,26 @@ class Server(object):
check_log("ZONE WAIT %s: %s" % (self.name, zone.name))
for t in range(20):
resp = self.dig(zone.name, "SOA", udp=True, tries=1, log_no_sep=True)
if resp.resp.rcode() == 0:
if not resp.resp.answer:
raise Exception("No SOA in ANSWER, zone='%s', server='%s'" %
(zone.name, self.name))
soa = str((resp.resp.answer[0]).to_rdataset())
_serial = int(soa.split()[5])
if serial:
if serial < _serial:
try:
resp = self.dig(zone.name, "SOA", udp=True, tries=1,
log_no_sep=True)
except:
pass
else:
if resp.resp.rcode() == 0:
if not resp.resp.answer:
raise Exception("No SOA in ANSWER, zone='%s', server='%s'" %
(zone.name, self.name))
soa = str((resp.resp.answer[0]).to_rdataset())
_serial = int(soa.split()[5])
if serial:
if serial < _serial:
break
else:
break
else:
break
time.sleep(2)
time.sleep(4)
else:
self.backtrace()
raise Exception("Can't get SOA%s, zone='%s', server='%s'" %
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment