mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
pytest: add simple test for --daemon.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
8c22b91a70
commit
41be796e0e
@@ -773,6 +773,31 @@ def test_cli(node_factory):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def test_daemon_option(node_factory):
|
||||||
|
"""
|
||||||
|
Make sure --daemon at least vaguely works!
|
||||||
|
"""
|
||||||
|
# Lazy way to set up command line and env, plus do VALGRIND checks
|
||||||
|
l1 = node_factory.get_node()
|
||||||
|
l1.stop()
|
||||||
|
|
||||||
|
os.unlink(l1.rpc.socket_path)
|
||||||
|
subprocess.run(l1.daemon.cmd_line + ['--daemon', '--log-file={}/log-daemon'.format(l1.daemon.lightning_dir)], env=l1.daemon.env,
|
||||||
|
check=True)
|
||||||
|
|
||||||
|
# Test some known output (wait for rpc to be ready)
|
||||||
|
wait_for(lambda: os.path.exists(l1.rpc.socket_path))
|
||||||
|
out = subprocess.check_output(['cli/lightning-cli',
|
||||||
|
'--lightning-dir={}'
|
||||||
|
.format(l1.daemon.lightning_dir),
|
||||||
|
'help']).decode('utf-8')
|
||||||
|
assert 'help [command]\n List available commands, or give verbose help on one {command}' in out
|
||||||
|
|
||||||
|
subprocess.run(['cli/lightning-cli',
|
||||||
|
'--lightning-dir={}'.format(l1.daemon.lightning_dir),
|
||||||
|
'stop'], check=True)
|
||||||
|
|
||||||
|
|
||||||
@flaky
|
@flaky
|
||||||
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
|
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
|
||||||
def test_blockchaintrack(node_factory, bitcoind):
|
def test_blockchaintrack(node_factory, bitcoind):
|
||||||
|
|||||||
Reference in New Issue
Block a user