summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-09-05 16:29:53 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-09-05 16:51:25 +0200
commit217bb01edca6fa9e5fc920cf596934727ffb92c3 (patch)
treeb0334a0e0b3d8627a817a0e22e4e301b54e5364f
parent8264bd8c0d3a713eac2cacec661a457c0fd97c88 (diff)
afb-test.sh: launch 2 binders for testflounder_5.99.6flounder/5.99.65.99.6
one binder for afb-test binding another for signal-composer binding Change-Id: Ie049715775e315eeb4e2d01e178ff55bb68f36e0 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rwxr-xr-xtest/afb-test.sh46
1 files changed, 27 insertions, 19 deletions
diff --git a/test/afb-test.sh b/test/afb-test.sh
index 96733bf..f792fb2 100755
--- a/test/afb-test.sh
+++ b/test/afb-test.sh
@@ -1,41 +1,49 @@
#!/bin/sh
trap "cleanup 0" EXIT
-trap "cleanup 1" SIGHUP SIGINT SIGABRT SIGTERM
+trap "cleanup 1" SIGINT SIGTERM SIGABRT SIGHUP
cleanup() {
- rm -f $LOGPIPE
- echo "Removing $LOGPIPE"
- trap '' EXIT SIGHUP SIGINT SIGABRT SIGTERM
+ trap '' SIGINT SIGTERM SIGABRT SIGHUP EXIT
+ kill $AFTESTPID > /dev/null 2>&1
+ rm -f $AFTESTSOCKET
+ pkill $PROCNAME
exit $1
}
BINDER=$(command -v afb-daemon)
AFBTEST="$(pkg-config --variable libdir afb-test)/aft.so"
-PROCNAME="aft-signal-composer"
-PORT=1234
+if [ ! $? -eq 0 ]; then echo "Set PKG_CONFIG_PATH for afb-test"; exit -1; fi
+PROCNAME="afbd-signal-composer"
+PORT1=1234
+PORT2=1235
TOKEN=
-LOGPIPE="test.pipe"
[ "$1" ] && BUILDDIR="$1" || exit 1
+AFTESTSOCKET=/tmp/signal-composer
TESTPACKAGEDIR="${BUILDDIR}/package-test"
-[ ! -p $LOGPIPE ] && mkfifo $LOGPIPE
export AFT_CONFIG_PATH="${TESTPACKAGEDIR}/etc"
export AFT_PLUGIN_PATH="${TESTPACKAGEDIR}/var:${TESTPACKAGEDIR}/lib/plugins"
pkill $PROCNAME
${BINDER} --name="${PROCNAME}" \
- --port="${PORT}" \
- --roothttp=. \
+ --port="${PORT1}" \
--tracereq=common \
--token=${TOKEN} \
+ --rootdir="${TESTPACKAGEDIR}/../package" \
--workdir="${TESTPACKAGEDIR}" \
--binding="../package/lib/afb-signal-composer.so" \
- --binding="$AFBTEST" \
- --call="aft-signal-composer/launch_all_tests:{}" \
- --call="aft-signal-composer/exit:{}" \
- -vvv > ${LOGPIPE} 2>&1 &
-
-while read -r line
-do
- [ "$(echo "${line}" | grep 'NOTICE: Browser URL=')" ] && break
-done < ${LOGPIPE} \ No newline at end of file
+ --ws-server=unix:${AFTESTSOCKET} > /dev/null 2>& 1 &
+AFTESTPID=$!
+
+sleep 0.3
+
+${BINDER} --name=aft-signal-composer \
+--workdir="package-test/" \
+--port="${PORT2}" \
+--binding=${AFBTEST} \
+--ws-client=unix:${AFTESTSOCKET} \
+--call="aft-signal-composer/launch_all_tests:{}" \
+--call="aft-signal-composer/exit:{}"
+
+find "${BUILDDIR}" -name test_results.log -exec cat {} \;
+