Skip to content

Commit

Permalink
pool: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sputn1ck committed Feb 3, 2021
1 parent db7f532 commit d605c31
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/pkgs-unstable.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let
hwi
joinmarket
lightning-loop
lightning-pool

## elementsd fails with error
# test/key_properties.cpp:16:10: fatal error: rapidcheck/boost_test.h: No such file or directory
Expand Down
11 changes: 11 additions & 0 deletions test/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ let testEnv = rec {

tests.lightning-loop = cfg.lightning-loop.enable;

tests.lightning-pool = cfg.lightning-pool.enable;
nix-bitcoin.onionServices.lnd.public=true;

tests.electrs = cfg.electrs.enable;

tests.liquidd = cfg.liquidd.enable;
Expand Down Expand Up @@ -116,6 +119,7 @@ let testEnv = rec {
services.spark-wallet.enable = true;
services.lnd.enable = true;
services.lightning-loop.enable = true;
services.lightning-pool.enable = true;
services.electrs.enable = true;
services.liquidd.enable = true;
services.btcpayserver.enable = true;
Expand Down Expand Up @@ -157,6 +161,7 @@ let testEnv = rec {
services.spark-wallet.enable = true;
services.lnd.enable = true;
services.lightning-loop.enable = true;
services.lightning-pool.enable = true;
services.electrs.enable = true;
services.btcpayserver.enable = true;
services.joinmarket.enable = true;
Expand Down Expand Up @@ -198,6 +203,12 @@ let testEnv = rec {
server.host=localhost
'';

# lightning-pool contains no builtin auction server for regtest.
# Add a dummy definition
services.lightning-pool.extraConfig = ''
auctionserver=localhost
'';

# Needs wallet support which is unavailable for regtest
services.joinmarket.yieldgenerator.enable = mkForce false;
};
Expand Down
23 changes: 22 additions & 1 deletion test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ def _():
)


@test("lightning-pool")
def _():
assert_running("lightning-pool")
assert_matches("su operator -c 'pool --version'", "version")
# Check that lightning-pool fails with the right error, making sure
# lightning-pool can connect to lnd
machine.wait_until_succeeds(
log_has_string(
"lightning-pool",
"Waiting for lnd to be fully synced to its chain backend, this might take a while",
)
)


@test("btcpayserver")
def _():
assert_running("nbxplorer")
Expand Down Expand Up @@ -323,7 +337,9 @@ def _():
pre_restart = succeed("date +%s.%6N").rstrip()

# Sanity-check system by restarting all services
succeed("systemctl restart bitcoind clightning lnd lightning-loop spark-wallet liquidd")
succeed(
"systemctl restart bitcoind clightning lnd lightning-loop lightning-pool spark-wallet liquidd"
)

# Now that the bitcoind restart triggered a banlist import restart, check that
# re-importing already banned addresses works
Expand Down Expand Up @@ -355,6 +371,11 @@ def _():
log_has_string("lightning-loop", "Starting event loop at height 10")
)
succeed("sudo -u operator loop getparams")
if "lightning-pool" in enabled_tests:
machine.wait_until_succeeds(
log_has_string("lightning-pool", "lnd is now fully synced to its chain backend")
)
succeed("sudo -u operator pool orders list")


if "netns-isolation" in enabled_tests:
Expand Down

0 comments on commit d605c31

Please sign in to comment.