1
0

tests: Add rudimentary integration test for Unix domain socket functionality

This commit is contained in:
yanmaani
2021-10-25 12:00:00 +00:00
parent b1005694ec
commit 82b9cd12eb
2 changed files with 23 additions and 0 deletions

View File

@@ -34,6 +34,13 @@ class TestLightning(unittest.TestCase):
self.run_shell(['stop', agent])
class TestUnixSockets(TestLightning):
agents = []
def test_unixsockets(self):
self.run_shell(['unixsockets'])
class TestLightningAB(TestLightning):
agents = ['alice', 'bob']

View File

@@ -356,3 +356,19 @@ if [[ $1 == "watchtower" ]]; then
echo "watchtower publishes justice transaction"
wait_until_spent $ctx_id 1 # alice's to_local gets punished immediately
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