btcpayserver: add tests
This commit is contained in:
@@ -2,6 +2,19 @@ def electrs():
|
||||
machine.wait_for_open_port(4224) # prometeus metrics provider
|
||||
|
||||
|
||||
def nbxplorer():
|
||||
machine.wait_for_open_port(24444)
|
||||
|
||||
|
||||
def btcpayserver():
|
||||
machine.wait_for_open_port(23000)
|
||||
# test lnd custom macaroon
|
||||
assert_matches(
|
||||
'sudo -u btcpayserver curl -s --cacert /secrets/lnd-cert --header "Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 /run/lnd/btcpayserver.macaroon)" -X GET https://127.0.0.1:8080/v1/getinfo | jq',
|
||||
'"version"',
|
||||
)
|
||||
|
||||
|
||||
def spark_wallet():
|
||||
machine.wait_for_open_port(9737)
|
||||
spark_auth = re.search("login=(.*)", succeed("cat /secrets/spark-wallet-login"))[1]
|
||||
@@ -31,6 +44,8 @@ def prestop():
|
||||
|
||||
extra_tests = {
|
||||
"electrs": electrs,
|
||||
"nbxplorer": nbxplorer,
|
||||
"btcpayserver": btcpayserver,
|
||||
"spark-wallet": spark_wallet,
|
||||
"lightning-charge": lightning_charge,
|
||||
"nanopos": nanopos,
|
||||
|
||||
@@ -10,6 +10,8 @@ nanopos_ip = "169.254.1.19"
|
||||
recurringdonations_ip = "169.254.1.20"
|
||||
nginx_ip = "169.254.1.21"
|
||||
lightningloop_ip = "169.254.1.22"
|
||||
nbxplorer_ip = "169.254.1.23"
|
||||
btcpayserver_ip = "169.254.1.24"
|
||||
|
||||
|
||||
def electrs():
|
||||
@@ -18,6 +20,20 @@ def electrs():
|
||||
) # prometeus metrics provider
|
||||
|
||||
|
||||
def nbxplorer():
|
||||
machine.wait_until_succeeds("ip netns exec nb-nbxplorer nc -z %s 24444" % nbxplorer_ip)
|
||||
|
||||
|
||||
def btcpayserver():
|
||||
machine.wait_until_succeeds("ip netns exec nb-btcpayserver nc -z %s 23000" % btcpayserver_ip)
|
||||
# test lnd custom macaroon
|
||||
assert_matches(
|
||||
'ip netns exec nb-btcpayserver sudo -u btcpayserver curl -s --cacert /secrets/lnd-cert --header "Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 /run/lnd/btcpayserver.macaroon)" -X GET https://%s:8080/v1/getinfo | jq'
|
||||
% lnd_ip,
|
||||
'"version"',
|
||||
)
|
||||
|
||||
|
||||
def spark_wallet():
|
||||
machine.wait_until_succeeds("ip netns exec nb-spark-wallet nc -z %s 9737" % sparkwallet_ip)
|
||||
spark_auth = re.search("login=(.*)", succeed("cat /secrets/spark-wallet-login"))[1]
|
||||
@@ -50,6 +66,7 @@ def web_index():
|
||||
def prestop():
|
||||
ping_bitcoind = "ip netns exec nb-bitcoind ping -c 1 -w 1"
|
||||
ping_nanopos = "ip netns exec nb-nanopos ping -c 1 -w 1"
|
||||
ping_nbxplorer = "ip netns exec nb-nbxplorer ping -c 1 -w 1"
|
||||
|
||||
# Positive ping tests (non-exhaustive)
|
||||
machine.succeed(
|
||||
@@ -57,6 +74,8 @@ def prestop():
|
||||
+ "%s %s &&" % (ping_bitcoind, clightning_ip)
|
||||
+ "%s %s &&" % (ping_bitcoind, lnd_ip)
|
||||
+ "%s %s &&" % (ping_bitcoind, liquidd_ip)
|
||||
+ "%s %s &&" % (ping_bitcoind, nbxplorer_ip)
|
||||
+ "%s %s &&" % (ping_nbxplorer, btcpayserver_ip)
|
||||
+ "%s %s &&" % (ping_nanopos, lightningcharge_ip)
|
||||
+ "%s %s &&" % (ping_nanopos, nanopos_ip)
|
||||
+ "%s %s" % (ping_nanopos, nginx_ip)
|
||||
@@ -77,7 +96,8 @@ def prestop():
|
||||
+ "%s %s ||" % (ping_nanopos, liquidd_ip)
|
||||
+ "%s %s ||" % (ping_nanopos, electrs_ip)
|
||||
+ "%s %s ||" % (ping_nanopos, sparkwallet_ip)
|
||||
+ "%s %s" % (ping_nanopos, recurringdonations_ip)
|
||||
+ "%s %s ||" % (ping_nanopos, recurringdonations_ip)
|
||||
+ "%s %s" % (ping_nanopos, btcpayserver_ip)
|
||||
)
|
||||
|
||||
# test that netns-exec can't be run for unauthorized namespace
|
||||
@@ -94,6 +114,8 @@ def prestop():
|
||||
|
||||
extra_tests = {
|
||||
"electrs": electrs,
|
||||
"nbxplorer": nbxplorer,
|
||||
"btcpayserver": btcpayserver,
|
||||
"spark-wallet": spark_wallet,
|
||||
"lightning-charge": lightning_charge,
|
||||
"nanopos": nanopos,
|
||||
|
||||
Reference in New Issue
Block a user