aboutsummaryrefslogtreecommitdiffstats
path: root/test/afb-test.sh
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-06-19 18:40:32 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-09 18:25:57 +0200
commit7c5d80deacad2a1f6943dd0b77449c3f6e20fdfc (patch)
tree0a6782a85994b38adf35aebefd9c5b5561c43f92 /test/afb-test.sh
parent0b188b21df19bac0cff339c738cd439e887436b8 (diff)
Create first tests to be used with afb-test binding The test binding is now found using pkg-config command. Change-Id: Ib1cd08236b6b8fab93ccb67ac613a9c83908d12e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test/afb-test.sh')
-rwxr-xr-xtest/afb-test.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/afb-test.sh b/test/afb-test.sh
new file mode 100755
index 00000000..eaebbe08
--- /dev/null
+++ b/test/afb-test.sh
@@ -0,0 +1,31 @@
+#!/bin/sh -x
+
+BINDER=$(command -v afb-daemon)
+CLIENT=$(command -v afb-client-demo)
+AFBTEST="$(pkg-config --variable libdir afb-test)/aft.so"
+PROCNAME="aft-low-can"
+PORT=1234
+TOKEN=
+LOGPIPE="test.log"
+[ "$1" ] && BUILDDIR="$1" || exit 1
+
+[ ! -p $LOGPIPE ] && mkfifo $LOGPIPE
+
+pkill $PROCNAME
+
+${BINDER} --name="${PROCNAME}" \
+--port="${PORT}" \
+--roothttp=. \
+--tracereq=common \
+--token=${TOKEN} \
+--workdir="${BUILDDIR}/package" \
+--binding="lib/afb-low-can.so" \
+--binding="$AFBTEST" \
+-vvv > ${LOGPIPE} 2>&1 &
+
+while read -r line
+do
+ [ "$(echo "${line}" | grep 'NOTICE: Browser URL=')" ] && break
+done < ${LOGPIPE}
+
+${CLIENT} ws://localhost:${PORT}/api?token=${TOKEN} afTest launch_all_tests