tests/test_lightningd.py: incorporate everything from old test-basic shell test.

This moves all the non-legacy blackbox testing into python.

Before:
	real	10m18.385s

After:
	real	9m54.877s

Note that this doesn't valgrind the subdaemons: that patch seems to cause
some issues in the python framework which I am still chasing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-04-29 10:32:27 +09:30
committed by Christian Decker
parent be3b5f11e8
commit f61da7eb64
6 changed files with 123 additions and 150 deletions

View File

@@ -74,7 +74,19 @@ class TailableProc(object):
logging.debug("%s: %s", self.prefix, line.decode().rstrip())
self.logs_cond.notifyAll()
self.running = False
def is_in_log(self, regex):
"""Look for `regex` in the logs."""
ex = re.compile(regex)
for l in self.logs:
if ex.search(l):
logging.debug("Found '%s' in logs", regex)
return True
logging.debug("Did not find '%s' in logs", regex)
return False
def wait_for_log(self, regex, offset=1000, timeout=60):
"""Look for `regex` in the logs.