aboutsummaryrefslogtreecommitdiffstats
path: root/test/afb-test.sh
blob: 38c46ffb27f1cf7399ab8ec3de5df0833da3e257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

BINDER=$(command -v afb-daemon)
AFBTEST="$(pkg-config --variable libdir afb-test)/aft.so"
PROCNAME="aft-persistence"
PORT=1234
TOKEN=
LOGFILE="test.log"
[ "$1" ] && BUILDDIR="$1" || exit 1

TESTPACKAGEDIR="${BUILDDIR}/package-test"
export AFT_CONFIG_PATH="${TESTPACKAGEDIR}/etc"
export AFT_PLUGIN_PATH="${TESTPACKAGEDIR}/var:${TESTPACKAGEDIR}/lib/plugins"

pkill $PROCNAME

timeout -s 9 10	 "${BINDER}" 	--name="${PROCNAME}" \
				--port="${PORT}" \
				--roothttp=. \
				--tracereq=common \
				--token=${TOKEN} \
				--workdir="${TESTPACKAGEDIR}" \
				--binding="../package/lib/afb-persistence-binding.so" \
				--binding="$AFBTEST" \
				--call="aft-persistence/launch_all_tests:{}" \
				--call="aft-persistence/exit:{}" \
				-vvv > "${LOGFILE}" 2>&1

find "${BUILDDIR}" -name test_results.log -exec cat {} \;