diff --git a/systest/daemon_interrupt.sh b/systest/daemon_interrupt.sh new file mode 100755 index 0000000000..c953017116 --- /dev/null +++ b/systest/daemon_interrupt.sh @@ -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 test --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