Skip to content

Commit

Permalink
Introduce a systest case for rpc stop command
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Apr 17, 2024
1 parent d306152 commit 2b5006f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions systest/rpc_stop.sh
Original file line number Diff line number Diff line change
@@ -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 --config rpc.enable=true --rpcconfig enable_control=true &
NODE_PID=$!

# Allow some time for the node to start up completely
sleep 10

# Send the stop rpc command
curl -g -d '{ "action": "stop" }' '[::1]:45000'

# 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

0 comments on commit 2b5006f

Please sign in to comment.