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

concurrentCTL: improved test

parent 08cc5b8e
No related branches found
No related tags found
No related merge requests found
Pipeline #127700 passed
This commit is part of merge request !1679. Comments created here will be created in the context of that merge request.
......@@ -24,7 +24,7 @@ def random_ctl(server, zone_name):
"zone-thaw", "zone-xfr-freeze", "zone-xfr-thaw", "zone-read", "zone-get",
"zone-stats", "conf-init", "conf-list", "conf-read", "conf-diff",
"conf-get"])
if cmd[0:5] == "zone-":
if cmd[0:5] == "zone-" and random.choice([False, True, True]):
cmd += " " + zone_name
if random.choice([False, True]):
cmd = "-b " + cmd
......@@ -58,7 +58,7 @@ def ctl_txn_generic(server, txn_start, txn_modify, txn_commit, txn_abort, abort_
random_sleep()
server.ctl(txn_commit, availability=False)
except:
attempts = 6
attempts = 9
while attempts > 0:
time.sleep(2)
attempts -= 1
......@@ -70,15 +70,19 @@ def ctl_txn_generic(server, txn_start, txn_modify, txn_commit, txn_abort, abort_
def bck_purge_rest(server, zone_name):
global zone_backup_running
if random.choice([False, True]) and not True in zone_backup_running.values():
zone_name = " "
if zone_name in zone_backup_running and zone_backup_running[zone_name]:
return
if " " in zone_backup_running and zone_backup_running[" "]:
return
zone_backup_running[zone_name] = True
bckdir = "%s/backup" % server.dir
bckdir += str(int(time.time()))
bckdir = " +backupdir " + bckdir
cmd_bck = "-t 14 -b zone-backup " + zone_name + bckdir
cmd_pur = "-b -f zone-purge " + zone_name
cmd_pur = "-b -f zone-purge " + ("--" if zone_name == " " else zone_name)
cmd_res = "-b zone-restore " + zone_name + bckdir
ctl_txn_generic(server, cmd_bck, cmd_pur, cmd_res, cmd_res, False)
try:
......@@ -144,7 +148,9 @@ for i in range(60):
for s in [ master, slave ]:
for z in zones:
try:
s.ctl("zone-xfr-thaw " + z.name, availability=False)
s.ctl("zone-thaw " + z.name, availability=False)
s.ctl("zone-notify " + z.name, availability=False)
except:
pass
......
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