Skip to content
Snippets Groups Projects
Commit 1492c4a9 authored by Libor Peltan's avatar Libor Peltan
Browse files

tests: improved blocking_txn not to fail and test better

parent 2d39009a
No related branches found
No related tags found
No related merge requests found
Pipeline #127452 passed
......@@ -61,10 +61,13 @@ if not BACKUP_FIRST:
master.ctl("zone-begin " + ZONE)
run_thr(background_backup, master, ZONE)
if BACKUP_FIRST:
t.sleep(2.1)
master.zones_wait(zones)
t.sleep(2.05)
try:
master.ctl("zone-begin " + ZONE)
has_soa = master.ctl("zone-get " + ZONE + " " + ZONE + " SOA", availability=False, read_result=True)
if not " SOA " in has_soa:
master.ctl("zone-abort " + ZONE, availability=False)
raise Exception("restored and not yet loaded")
except:
t.sleep(1)
master.zones_wait(zones)
......
......@@ -383,7 +383,7 @@ class Server(object):
self.binding_errors = errors
def ctl(self, cmd, wait=False, availability=True):
def ctl(self, cmd, wait=False, availability=True, read_result=False):
if availability:
# Check for listening control interface.
ok = False
......@@ -413,6 +413,10 @@ class Server(object):
# Allow the command to complete, Bind needs this.
self.wait_function(wait)
if read_result:
with open(self.dir + "/call.out", "r") as f:
return f.readlines()[-1]
def reload(self):
self.ctl("reload")
time.sleep(Server.START_WAIT)
......
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