12 lines
716 B
Bash
Executable File
12 lines
716 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Real socket test; never use on a host with an active MARS broker.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
[[ $EUID == 0 ]] || { echo 'Use sudo make check-ncp-ip-integration on an isolated test host'; exit 1; }
|
|
[[ ! -S /run/mars-pcap/transport.sock ]] || { echo 'Existing MARS broker; test aborted'; exit 1; }
|
|
config=$(mktemp); chmod 600 "$config"; printf '{"enabled":true,"address":"127.0.0.1","slp":true}' > "$config"
|
|
./build/mars-pcapd --offline-test --test-ip-config "$config" & pid=$!
|
|
trap 'kill "$pid" 2>/dev/null || true; wait "$pid" 2>/dev/null || true; rm -f "$config"' EXIT
|
|
for i in $(seq 1 50); do [[ -S /run/mars-pcap/transport.sock ]] && break; sleep .1; done
|
|
./build/test-ncp-ip
|