Add daemon interrupt test

This commit is contained in:
Piotr Wójcik 2024-04-14 21:24:01 +02:00
commit 01a1e672f8

22
systest/daemon_interrupt.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
set -eux
DATADIR=$(mktemp -d)
# Start the node in daemon mode in the background
$NANO_NODE_EXE --daemon --network dev --data_path $DATADIR &
NODE_PID=$!
# Allow some time for the node to start up completely
sleep 10
# Send an interrupt signal to the node process
kill -SIGINT $NODE_PID
# Check if the process has stopped using a timeout to avoid infinite waiting
if wait $NODE_PID; then
echo "Node stopped successfully"
else
echo "Node did not stop as expected"
exit 1
fi