From 9807dce520e2e966b69e3bca1ae0aeaab6e9c8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:24:01 +0200 Subject: [PATCH] Add daemon interrupt test --- systest/daemon_interrupt.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 systest/daemon_interrupt.sh 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