Files
mgmt/test/shell/no-network.sh
2019-02-24 12:28:59 -05:00

27 lines
581 B
Bash
Executable File

#!/bin/bash
. "$(dirname "$0")/../util.sh"
# Tests the behaviour of the --no-network
set -o errexit
set -o pipefail
tmpdir="$($mktemp --tmpdir -d tmp.XXX)"
# run empty graph, with standalone enabled
$TIMEOUT "$MGMT" run --no-network --prefix "$tmpdir" empty &
pid=$!
# kill server on error/exit
trap 'kill -SIGINT "$pid"' EXIT
# give mgmt a little time to startup
sleep 10
# standalone mgmt should not listen on any tcp ports
lsof -i | grep "$pid" | grep TCP && false
# instead unix domain sockets should have been created
test -S "servers.sock:0"
test -S "clients.sock:0"