Commit Graph

16 Commits

Author SHA1 Message Date
Rusty Russell 733e0aeccf tests/utils.py: wait_for_log automatic offset.
I have a test which waits for multiple occurrences of the same string,
but doesn't want them to overlap.  Make wait_for_log() do the right thing,
so that it only looks for log entries since the last wait_for_log.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30
Rusty Russell e161c11e40 tests/utils.py: poll mempool instead of sleeping.
On my laptop under load, 5 seconds was no longer enough for legacy.
But this breaks async (they all see mempool increase, and fire
prematurely), so stop doing that.

I can't get this test to work at all, in fact, without this patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30
Rusty Russell 780b3870ad lightningd: peer state cleanup.
1. We explicitly assert what state we're coming from, to make transitions
   clearer.
2. Every transition has a state, even between owners while waiting for HSM.
3. Explictly step though getting the HSM signature on the funding tx
   before starting channeld, rather than doing it in parallel: makes
   states clearer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-25 14:24:47 +09:30
Rusty Russell 34e6e56471 lightningd: introduce peer_state enum.
The actual state names are place holders for now, really.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-25 14:24:47 +09:30
Rusty Russell 6dcd7f9d6d tests: dump more information when we fail to find something in logs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-05 16:11:46 +09:30
Rusty Russell 2641ecaafa test_lightningd.py: dump logs on error.
I couldn't actually figure out how to just dump them on error, so I
dump all the time.  When running 3 lightningd + bitcoind, this separates
the logs nicely.

TODO: We should delete the directories on success!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-03 11:47:10 +09:30
Christian Decker dc7b832e83 pytest: Added gossip test for new daemon 2017-05-02 11:59:24 +09:30
Rusty Russell f61da7eb64 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>
2017-04-29 10:30:10 +02:00
Christian Decker 810e12381a pytest: Simple wrapper around BitcoinProxy to avoid timeouts
Running long integration tests could result in `bitcoind` dropping the
connection inbetween calls, and since python-bitcoinlib does not
reconnect and/or retry, all subsequent tests would fail as well. This
patch switches to throwaway connections, each serving just one
request. It's easier than to reach into the bitcoinlib to reconnect
and reauth, but comes with some overhead, but I think it's acceptable
for the few bitcoin calls we actually perform.
2017-04-28 13:39:45 +09:30
Christian Decker 5028f7b9d9 fixup! pylightning: RPC returns a failure if the connection is lost 2017-03-20 11:18:00 +10:30
Christian Decker c7e6f197b0 pytest: Chaning startup sentinel for bitcoind.
By looking for 'Done loading' in the log output we should actually be
called after `SetRPCWarmupFinished` in bitcoind. Only then is it safe
to make RPC calls. This resulted in the test suite being a bit flaky.
2017-02-08 16:59:56 +01:00
Christian Decker 66175c7361 Merge pull request #115 from ElementsProject/pytest-pathfix
pytest: don't assume paths of valgrind and bitcoind.
2017-01-24 14:22:23 +01:00
Rusty Russell 1575181ef5 pytest: don't assume paths of valgrind and bitcoind.
In particular, my bitcoind is in /usr/local/bin

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-24 14:37:56 +10:30
Christian Decker 1948062250 pytest: Using python-bitcoinlib instead of python-bitcoinrpc
The latter is unmaintained and has a number of problems.
2017-01-23 10:37:34 +01:00
Christian Decker 180c96776b pytest: Split the python integration tests into new and legacy 2017-01-23 10:37:34 +01:00
Christian Decker 41a5e74db9 pytest: Implement utilities for python unittests 2017-01-23 10:45:36 +10:30