Fedora 30 packaging fix issu
[src/app-framework-binder.git] / stress-server.sh
1 #!/bin/bash
2
3 ROOT=$(dirname $0)
4 cd ${ROOT:-.}
5 ROOT=$(pwd)
6 echo ROOT=$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-knock
13 OUT=stress-out-server
14
15 rm $OUT*
16
17 case "$1" in
18  --ws)
19   shift
20   ARGS="-q --no-ldpaths --binding=$HELLO --session-max=100 --ws-server=unix:@afw:hello --no-httpd --exec $AFB --session-max=100 --port=$PORT --no-ldpaths --roothttp=$TEST --token=$TOKEN --ws-client=unix:@afw:hello "
21 #  ARGS="$ARGS -vvv --tracereq=all"
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 $AFB $ARGS $@
30 echo -n launch afb...
31 case "$1" in
32  gdb) shift; gdb $AFB -ex "run $ARGS $@";;
33  valgrind) shift; valgrind --leak-check=full $AFB $ARGS $@ 2>&1 | tee $OUT;;
34  strace) shift; strace -tt -f -o $OUT.strace $AFB $ARGS $@ 2>&1 | tee $OUT;;
35  *) $AFB $ARGS $@ 2>&1 | tee $OUT;;
36 esac
37 #$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO  > $OUT.0 2>&1 &
38 #afbpid=$!
39 #strace -tt -f -o $OUT-strace.0 -p $afbpid &
40 wait