Implement subcall for services over websockets
[src/app-framework-binder.git] / stress-server.sh
1 #!/bin/bash
2
3 ROOT=$(dirname $0)
4 echo ROOT=$ROOT
5
6 cd $ROOT
7
8 AFB=build/src/afb-daemon
9 HELLO=build/bindings/samples/helloWorld.so
10 PORT=12345
11 TEST=test
12 TOKEN=knock-knock-knoc
13 OUT=stress-out-server
14
15 rm $OUT*
16
17 case "$1" in
18  --ws)
19   shift
20   ARGS="-q --ldpaths=/tmp --binding=$HELLO --session-max=100 --ws-server=unix:hello --no-httpd --exec $AFB --session-max=100 --port=$PORT --ldpaths=/tmp --roothttp=$TEST --token=$TOKEN --ws-client=unix:hello "
21 #  ARGS="-vv --tracereq=all --ldpaths=/tmp --binding=$HELLO --session-max=100 --ws-server=unix:hello --no-httpd --exec $AFB --session-max=100 --port=$PORT --ldpaths=/tmp --roothttp=$TEST --token=$TOKEN --ws-client=unix:hello "
22   ;;
23  *)
24   ARGS="-q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO"
25   ;;
26 esac
27
28
29 echo -n launch afb...
30 case "$1" in
31  gdb) shift; gdb $AFB -ex "run $ARGS $@";;
32  valgrind) shift; valgrind --leak-check=full $AFB $ARGS $@ 2>&1 | tee $OUT;;
33  strace) shift; strace -tt -f -o $OUT.strace $AFB $ARGS $@ 2>&1 | tee $OUT;;
34  *) $AFB $ARGS $@ 2>&1 | tee $OUT;;
35 esac
36 #$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO  > $OUT.0 2>&1 &
37 #afbpid=$!
38 #strace -tt -f -o $OUT-strace.0 -p $afbpid &
39 wait