electrs test: make service shutdown optional

Needed for regtest scenario.
This commit is contained in:
Erik Arvstedt
2020-10-16 18:01:52 +02:00
parent eb42fc8e06
commit 1f96ca67c5
2 changed files with 9 additions and 2 deletions
+3
View File
@@ -105,6 +105,9 @@ let testEnv = rec {
services.nix-bitcoin-webindex.enable = true; services.nix-bitcoin-webindex.enable = true;
tests.secure-node = true; tests.secure-node = true;
tests.banlist-and-restart = true; tests.banlist-and-restart = true;
# Stop electrs from spamming the test log with 'WARN - wait until IBD is over' messages
tests.stop-electrs = true;
}; };
netns = { netns = {
+6 -2
View File
@@ -111,14 +111,18 @@ def _():
) )
# Impure: Stops electrs
@test("electrs") @test("electrs")
def _(): def _():
assert_running("electrs") assert_running("electrs")
wait_for_open_port(ip("electrs"), 4224) # prometeus metrics provider wait_for_open_port(ip("electrs"), 4224) # prometeus metrics provider
# Check RPC connection to bitcoind # Check RPC connection to bitcoind
machine.wait_until_succeeds(log_has_string("electrs", "NetworkInfo")) machine.wait_until_succeeds(log_has_string("electrs", "NetworkInfo"))
# Stop electrs from spamming the test log with 'wait for bitcoind sync' messages
# Impure: Stops electrs
# Stop electrs from spamming the test log with 'WARN - wait until IBD is over' messages
@test("stop-electrs")
def _():
succeed("systemctl stop electrs") succeed("systemctl stop electrs")