From 9a931483b9a4be260b17b63e20eda829bad1281b Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 29 Oct 2020 21:20:25 +0100 Subject: [PATCH] netns test: remove strict dependency on clightning, electrs This allows the netns test to be run with a reduced service set for debugging. --- test/tests.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/tests.py b/test/tests.py index 931d1ce..e2f918e 100644 --- a/test/tests.py +++ b/test/tests.py @@ -259,16 +259,17 @@ def _(): assert_unreachable("bitcoind", ["btcpayserver", "spark-wallet", "lightning-loop"]) assert_unreachable("btcpayserver", ["bitcoind", "lightning-loop", "liquidd"]) - # test that netns-exec can't be run for unauthorized namespace - machine.fail("netns-exec nb-electrs ip a") - - # test that netns-exec drops capabilities + # netns-exec should drop capabilities assert_full_match( "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 - machine.fail("sudo -u clightning netns-exec nb-bitcoind ip a") + if "clightning" in enabled_tests: + # 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)