aboutsummaryrefslogtreecommitdiff
path: root/scripts/test-dbus-proxy.sh
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-10-03 14:14:29 +0800
committerAndy Green <andy@warmcat.com>2018-10-13 08:16:27 +0800
commit47e10ab20055a267fcb3eaf8662220b4125f00d5 (patch)
tree6d9680c75366f9545705667d8501749ef741f3fa /scripts/test-dbus-proxy.sh
parent31dfc4aa12e1a733346d992c6b1173153173aedf (diff)
downloadlibwebsockets-47e10ab20055a267fcb3eaf8662220b4125f00d5.tar.gz
dbus-ws-proxy
This builds on the new dbus role support to provide a minimal example proxy between ws and dbus. A client app is provided that asks the proxy to connect to libwebsockets.org and proxy the drawing data from the mirror example there back to the dbus client using dbus messages.
Diffstat (limited to 'scripts/test-dbus-proxy.sh')
-rwxr-xr-xscripts/test-dbus-proxy.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/test-dbus-proxy.sh b/scripts/test-dbus-proxy.sh
new file mode 100755
index 00000000..1aec16f7
--- /dev/null
+++ b/scripts/test-dbus-proxy.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+echo "Starting $0"
+
+bin/lws-minimal-dbus-ws-proxy 2> /tmp/dbuss&
+
+echo " server starting"
+sleep 1s
+PID_PROX=$!
+
+echo " client starting"
+bin/lws-minimal-dbus-ws-proxy-testclient -x 10 2> /tmp/dbusc
+R=$?
+
+kill -2 $PID_PROX
+
+if [ $R -ne 0 ] ; then
+ echo "$0 FAILED"
+ cat /tmp/dbuss
+ cat /tmp/dbusc
+ exit 1
+fi
+
+if [ -z "`cat /tmp/dbusc | grep 'rx: 9, tx: 9'`" ] ; then
+ echo "$0 FAILED"
+ cat /tmp/dbuss
+ cat /tmp/dbusc
+ exit 1
+fi
+
+echo "$0 PASSED"
+
+exit 0
+