aboutsummaryrefslogtreecommitdiffstats
path: root/stress-server.sh
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-02-08 18:11:28 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-02-08 18:11:28 +0100
commitf47f9d84730e2bfe7b1dc465d14b09db34dc3076 (patch)
tree16a6aa217c2f72fee6b977443bb8c1c1b34b444e /stress-server.sh
parent6415858bb8daa5f0c29392f18e7a230136916ec1 (diff)
stress: Improve the stress test scripts
The improvement was able to track the bug SPEC-2163 by launching: - ./stress-server.sh --ws --valgrind - ./stress-clients.sh --null --count 20 Bug-AGL: SPEC-2163 Change-Id: I04634f0e98ab7a28df7c1d34ecc0d9c1faf43d57 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'stress-server.sh')
-rwxr-xr-xstress-server.sh52
1 files changed, 31 insertions, 21 deletions
diff --git a/stress-server.sh b/stress-server.sh
index 643c8990..1649e64d 100755
--- a/stress-server.sh
+++ b/stress-server.sh
@@ -6,35 +6,45 @@ ROOT=$(pwd)
echo ROOT=$ROOT
AFB=build/src/afb-daemon
-HELLO=build/bindings/samples/helloWorld.so
+HELLO=build/bindings/samples/hello3.so
PORT=12345
TEST=test
TOKEN=knock-knock-knock
-OUT=stress-out-server
+OUT=stress-out-server
rm $OUT*
-case "$1" in
- --ws)
- shift
- 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 "
-# ARGS="$ARGS -vvv --tracereq=all"
- ;;
- *)
- ARGS="-q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO"
- ;;
+tool=
+ws=false
+eval set -- $(getopt -o wgsv -l ws,gdb,strace,valgrind -- "$@") || exit
+while true
+do
+ case "$1" in
+ -w|--ws) ws=true; shift;;
+ -g|--gdb) tool=gdb; shift;;
+ -s|--strace) tool=strace; shift;;
+ -v|--valgrind) tool=valgrind; shift;;
+ --) shift; break;;
+ esac
+done
+
+case $tool in
+ gdb) cmd="$(type -p gdb) -ex run --args";;
+ valgrind) cmd="$(type -p valgrind) --leak-check=full";;
+ strace) cmd="$(type -p strace) -tt -f -o $OUT.strace";;
+ *) cmd=;;
esac
+if $ws; then
+ CMD="$AFB -q --no-ldpaths --binding=$HELLO --session-max=100 --ws-server=unix:@afw/hello --no-httpd --exec $cmd $AFB --session-max=100 --port=$PORT --no-ldpaths --roothttp=$TEST --token=$TOKEN --ws-client=unix:@afw/hello "
+else
+ CMD="$cmd $AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --no-ldpaths --binding=$HELLO"
+fi
+
-echo $AFB $ARGS $@
-echo -n launch afb...
-case "$1" in
- gdb) shift; gdb $AFB -ex "run $ARGS $@";;
- valgrind) shift; valgrind --leak-check=full $AFB $ARGS $@ 2>&1 | tee $OUT;;
- strace) shift; strace -tt -f -o $OUT.strace $AFB $ARGS $@ 2>&1 | tee $OUT;;
- *) $AFB $ARGS $@ 2>&1 | tee $OUT;;
+echo "launch: $CMD $@"
+case $tool in
+ gdb) $CMD "$@";;
+ *) $CMD "$@" 2>&1 | tee $OUT;
esac
-#$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO > $OUT.0 2>&1 &
-#afbpid=$!
-#strace -tt -f -o $OUT-strace.0 -p $afbpid &
wait