n2n/scripts/test_integration_supernode.sh

37 lines
867 B
Bash
Raw Normal View History

#!/bin/sh
#
# Do some quick tests via the Json API against the supernode
#
AUTH=n2n
# boilerplate so we can support whaky cmake dirs
[ -z "$TOPDIR" ] && TOPDIR=.
[ -z "$BINDIR" ] && BINDIR=.
docmd() {
echo "###"
"$@"
echo
}
# start it running in the background
2023-06-24 15:34:30 +02:00
docmd "${BINDIR}"/supernode -v
2023-06-25 14:49:31 +02:00
# TODO: probe the api endpoint, waiting for the supernode to be available?
sleep 0.1
2023-06-24 15:34:30 +02:00
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 communities
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 packetstats
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 edges --raw
2023-06-24 15:34:30 +02:00
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 verbose
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 -k $AUTH --write verbose 1
# looks strange, but we are querying the state of the "stop" verb
2023-06-24 15:34:30 +02:00
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 stop
# stop it
2023-06-24 15:34:30 +02:00
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 -k $AUTH --write stop