add argument to stress-server.sh
[src/app-framework-binder.git] / stress-server.sh
1 #!/bin/bash
2
3 ROOT=$(dirname $0)
4 echo ROOT=$ROOT
5
6 AFB=$ROOT/build/src/afb-daemon
7 HELLO=build/bindings/samples/helloWorld.so
8 PORT=12345
9 TEST=test
10 TOKEN=knock-knock-knoc
11 OUT=$ROOT/stress-out-server
12
13 rm $OUT*
14
15 ARGS="-q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO"
16
17 echo -n launch afb...
18 case "$1" in
19  gdb) shift; gdb $AFB -ex "run $ARGS $@";;
20  valgrind) shift; valgrind --leak-check=full $AFB $ARGS $@ 2>&1 | tee $OUT;;
21  strace) shift; strace -tt -f -o $OUT.strace $AFB $ARGS $@ 2>&1 | tee $OUT;;
22  *) $AFB $ARGS $@ 2>&1 | tee $OUT;;
23 esac
24 #$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO  > $OUT.0 2>&1 &
25 #afbpid=$!
26 #strace -tt -f -o $OUT-strace.0 -p $afbpid &
27 wait