1#!/bin/sh
2
3### Find script directory and load helper functions.
4scriptdir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
5. ${scriptdir}/shared_test_functions.sh
6
7
8### Project-specific constants and setup
9
10out="${bindir}/tests-output"
11out_valgrind="${bindir}/tests-valgrind"
12
13# This test script requires three sockets.
14src_sock="[127.0.0.1]:8001"
15mid_sock="[127.0.0.1]:8002"
16dst_sock="[127.0.0.1]:8003"
17
18# Find relative spiped binary paths.
19spiped_binary=${scriptdir}/../spiped/spiped
20spipe_binary=${scriptdir}/../spipe/spipe
21nc_client_binary=${scriptdir}/../tests/nc-client/nc-client
22nc_server_binary=${scriptdir}/../tests/nc-server/nc-server
23dnsthread_resolve=${scriptdir}/../tests/dnsthread-resolve/dnsthread-resolve
24
25# Find system spiped
26system_spiped_binary=$( find_system spiped )
27
28# Check for required commands.
29if ! command -v ${spiped_binary} >/dev/null 2>&1; then
30	echo "spiped not detected; did you forget to run 'make all'?"
31	exit 1
32fi
33if ! command -v ${spipe_binary} >/dev/null 2>&1; then
34	echo "spiped not detected; did you forget to run 'make all'?"
35	exit 1
36fi
37
38# Functions to help start and stop servers
39. ${scriptdir}/spiped_servers.sh
40
41
42### Run tests using project-specific constants
43run_scenarios
44