6 AFB=$ROOT/build/src/afb-daemon
7 CLI="$ROOT/build/src/afb-client-demo -e -s"
9 TOKEN=knock-knock-knock
13 eval set -- $(getopt -o c:n -l count:,null -- "$@") || exit
18 if ! test "$2" -gt 0 2>/dev/null; then
19 echo "error: $2 is not a valid count" >&2
36 OUT="$ROOT/stress-out-clients"
38 rm $OUT.* 2> /dev/null
52 hello PiNgJsOn {"well":"formed","json":[1,2,3,4.5,true,false,null,"oups"]}
53 hello subcall {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
54 hello subcall {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
55 hello subcallsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
56 hello subcallsync {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
57 hello subcall {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
58 hello subcallsync {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
59 hello eventadd {"tag":"ev1","name":"event-A"}
60 hello eventadd {"tag":"ev2","name":"event-B"}
61 hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
62 hello eventpush {"tag":"ev2","data":{"item":0}}
63 hello eventsub {"tag":"ev2"}
64 hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
65 hello eventpush {"tag":"ev2","data":{"item":0}}
66 hello eventsub {"tag":"ev1"}
67 hello subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
68 hello subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
69 hello subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
70 hello subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
71 hello eventunsub {"tag":"ev2"}
72 hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
73 hello eventpush {"tag":"ev2","data":{"item":0}}
74 hello eventdel {"tag":"ev1"}
75 hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
76 hello eventpush {"tag":"ev2","data":{"item":0}}
77 hello eventdel {"tag":"ev2"}
82 while :; do commands; done |
83 $CLI "localhost:$PORT/api?token=$TOKEN" > "$1" 2>&1 &
86 echo launch clients...
88 while test $i -le $count; do
89 echo " + launch clients $i"