netns test: remove strict dependency on clightning, electrs

This allows the netns test to be run with a reduced service set for debugging.
This commit is contained in:
Erik Arvstedt 2020-10-29 21:20:25 +01:00
parent bae1b7f413
commit 9a931483b9
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -259,16 +259,17 @@ def _():
assert_unreachable("bitcoind", ["btcpayserver", "spark-wallet", "lightning-loop"]) assert_unreachable("bitcoind", ["btcpayserver", "spark-wallet", "lightning-loop"])
assert_unreachable("btcpayserver", ["bitcoind", "lightning-loop", "liquidd"]) assert_unreachable("btcpayserver", ["bitcoind", "lightning-loop", "liquidd"])
# test that netns-exec can't be run for unauthorized namespace # netns-exec should drop capabilities
machine.fail("netns-exec nb-electrs ip a")
# test that netns-exec drops capabilities
assert_full_match( assert_full_match(
"su operator -c 'netns-exec nb-bitcoind capsh --print | grep Current '", "Current: =\n" "su operator -c 'netns-exec nb-bitcoind capsh --print | grep Current '", "Current: =\n"
) )
# test that netns-exec can not be executed by users that are not operator if "clightning" in enabled_tests:
machine.fail("sudo -u clightning netns-exec nb-bitcoind ip a") # netns-exec should fail for unauthorized namespaces
machine.fail("netns-exec nb-clightning ip a")
# netns-exec should only be executable by the operator user
machine.fail("sudo -u clightning netns-exec nb-bitcoind ip a")
# Impure: stops bitcoind (and dependent services) # Impure: stops bitcoind (and dependent services)