Commit ab552d87 authored by Kirill Smelkov's avatar Kirill Smelkov Committed by Julien Muchembled

tests/threaded: Add handy shortcuts to NEOCluster to concisely check cluster properties in tests

parent d9dd39f0
......@@ -668,10 +668,20 @@ class NEOCluster(object):
return admin
###
# More handy shortcuts for tests
@property
def backup_tid(self):
return self.neoctl.getRecovery()[1]
@property
def last_tid(self):
return self.primary_master.getLastTransaction()
@property
def primary_master(self):
master, = [master for master in self.master_list if master.primary]
return master
###
def reset(self, clear_database=False):
for node_type in 'master', 'storage', 'admin':
......
......@@ -142,7 +142,7 @@ class ReplicationTests(NEOThreadedTest):
self.tic()
self.tic()
self.assertEqual(np*nr, self.checkBackup(backup,
max_tid=backup.master.getLastTransaction()))
max_tid=backup.last_tid))
finally:
backup.stop()
backup.reset()
......@@ -160,7 +160,7 @@ class ReplicationTests(NEOThreadedTest):
self.tic()
self.tic()
self.assertEqual(np*nr, self.checkBackup(backup,
max_tid=backup.master.getLastTransaction()))
max_tid=backup.last_tid))
finally:
backup.stop()
finally:
......
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