faster and improved regtests

- print the test name before each test
 - start only needed agents (alice, bob, carol)
 - set settle_delay using setconfig instead of restarting daemon
 - test the watchtower ctn in test_watchtower
This commit is contained in:
ThomasV
2020-02-02 14:50:08 +01:00
parent cded582fe9
commit 4ec86d36a8
5 changed files with 77 additions and 66 deletions
+17 -3
View File
@@ -15,11 +15,25 @@ class TestLightning(unittest.TestCase):
assert process.returncode == 0
def setUp(self):
self.run_shell(['init'])
self.run_shell(['start'])
test_name = self.id().split('.')[-1]
sys.stdout.write("***** %s ******\n" % test_name)
self.agents = ['alice', 'bob']
if test_name in ['test_forwarding', 'test_watchtower']:
self.agents.append('carol')
# initialize and get funds
for agent in self.agents:
self.run_shell(['init', agent])
# mine a block so that funds are confirmed
self.run_shell(['new_block'])
# extra configuration (optional)
self.run_shell(['configure_' + test_name])
# start daemons
for agent in self.agents:
self.run_shell(['start', agent])
def tearDown(self):
self.run_shell(['stop'])
for agent in self.agents:
self.run_shell(['stop', agent])
def test_breach(self):
self.run_shell(['breach'])