Add tests for data persistence binding
[apps/agl-service-data-persistence.git] / test / afb-test.sh
1 #!/bin/sh
2
3 BINDER=$(command -v afb-daemon)
4 AFBTEST="$(pkg-config --variable libdir afb-test)/aft.so"
5 PROCNAME="aft-persistence"
6 PORT=1234
7 TOKEN=
8 LOGFILE="test.log"
9 [ "$1" ] && BUILDDIR="$1" || exit 1
10
11 TESTPACKAGEDIR="${BUILDDIR}/package-test"
12 export AFT_CONFIG_PATH="${TESTPACKAGEDIR}/etc"
13 export AFT_PLUGIN_PATH="${TESTPACKAGEDIR}/var:${TESTPACKAGEDIR}/lib/plugins"
14
15 pkill $PROCNAME
16
17 timeout -s 9 10  "${BINDER}"    --name="${PROCNAME}" \
18                                 --port="${PORT}" \
19                                 --roothttp=. \
20                                 --tracereq=common \
21                                 --token=${TOKEN} \
22                                 --workdir="${TESTPACKAGEDIR}" \
23                                 --binding="../package/lib/afb-persistence-binding.so" \
24                                 --binding="$AFBTEST" \
25                                 --call="aft-persistence/launch_all_tests:{}" \
26                                 --call="aft-persistence/exit:{}" \
27                                 -vvv > "${LOGFILE}" 2>&1
28
29 find "${BUILDDIR}" -name test_results.log -exec cat {} \;