tests: Add rudimentary integration test for Unix domain socket functionality
This commit is contained in:
@@ -34,6 +34,13 @@ class TestLightning(unittest.TestCase):
|
|||||||
self.run_shell(['stop', agent])
|
self.run_shell(['stop', agent])
|
||||||
|
|
||||||
|
|
||||||
|
class TestUnixSockets(TestLightning):
|
||||||
|
agents = []
|
||||||
|
|
||||||
|
def test_unixsockets(self):
|
||||||
|
self.run_shell(['unixsockets'])
|
||||||
|
|
||||||
|
|
||||||
class TestLightningAB(TestLightning):
|
class TestLightningAB(TestLightning):
|
||||||
agents = ['alice', 'bob']
|
agents = ['alice', 'bob']
|
||||||
|
|
||||||
|
|||||||
@@ -356,3 +356,19 @@ if [[ $1 == "watchtower" ]]; then
|
|||||||
echo "watchtower publishes justice transaction"
|
echo "watchtower publishes justice transaction"
|
||||||
wait_until_spent $ctx_id 1 # alice's to_local gets punished immediately
|
wait_until_spent $ctx_id 1 # alice's to_local gets punished immediately
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "unixsockets" ]]; then
|
||||||
|
# This looks different because it has to run the entire daemon
|
||||||
|
# Test domain socket behavior
|
||||||
|
./run_electrum --regtest daemon -d --rpcsock=unix # Start daemon with unix domain socket
|
||||||
|
./run_electrum --regtest stop # Errors if it can't connect
|
||||||
|
# Test custom socket path
|
||||||
|
f=$(mktemp --dry-run)
|
||||||
|
./run_electrum --regtest daemon -d --rpcsock=unix --rpcsockpath=$f
|
||||||
|
[ -S $f ] # filename exists and is socket
|
||||||
|
./run_electrum --regtest stop
|
||||||
|
rm $f # clean up
|
||||||
|
# Test for regressions in the ordinary TCP functionality.
|
||||||
|
./run_electrum --regtest daemon -d --rpcsock=tcp
|
||||||
|
./run_electrum --regtest stop
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user