Add daemon interrupt test
This commit is contained in:
parent
a8522e9ccc
commit
01a1e672f8
1 changed files with 22 additions and 0 deletions
22
systest/daemon_interrupt.sh
Executable file
22
systest/daemon_interrupt.sh
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue