Skip to content

Commit

Permalink
better test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Caruccio committed Feb 9, 2012
1 parent 07f6e4f commit ce2746a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions fapws/mainloop.c
Expand Up @@ -95,6 +95,8 @@ void close_cb(struct ev_loop *loop, struct ev_io *w, int revents)
LDEBUG(">> ENTER close_cb cli=%p", cli);
unregister_client(cli);
close_connection(cli);
ev_io_stop(EV_A_ &cli->ev_write);
ev_io_stop(EV_A_ &cli->ev_read);
ev_io_stop(EV_A_ w);
LDEBUG("<< EXIT close_cb cli=%p", cli);
}
Expand Down
14 changes: 11 additions & 3 deletions sample/push/get.sh
@@ -1,6 +1,14 @@
#!/bin/bash -e

channel='ch_teste'
id=${1:-1}
channel=${2:-'ch_teste'}
url="http://localhost:8080/broadcast/sub?ch=$channel&m=$id&s=M"
c=${3:-1}

curl -m 600 -v "http://localhost:8080/broadcast/sub?ch=$channel&m=$id&s=M"
#ab -c50 -n50 -t 600 "http://localhost:8080/broadcast/sub?ch=$channel&m=$id&s=M"
for ((i=0; i<$c; i++))
do
curl -m 600 -v "$url" &
done

wait
#ab -c10 -n50 -t 600 "$url"
2 changes: 1 addition & 1 deletion sample/push/getall.sh
@@ -1,4 +1,4 @@

channel='ch_teste'
channel="${1:-ch_teste}"

curl -v "http://localhost:8080/broadcast/sub?ch=$channel&s=A"
4 changes: 2 additions & 2 deletions sample/push/getfirst.sh
@@ -1,5 +1,5 @@

channel='ch_teste'
cnt=${1:-3}
channel="${1:-ch_teste}"
cnt=${2:-3}

curl -v "http://localhost:8080/broadcast/sub?ch=$channel&m=$cnt&s=F"
4 changes: 2 additions & 2 deletions sample/push/getlast.sh
@@ -1,5 +1,5 @@

channel='ch_teste'
cnt=${1:-3}
channel="${1:-ch_teste}"
cnt=${2:-3}

curl -v "http://localhost:8080/broadcast/sub?ch=$channel&m=$cnt&s=L"
7 changes: 5 additions & 2 deletions sample/push/post.sh
@@ -1,7 +1,8 @@

date=`date +%s`
channel='ch_teste'
id=${1:-1}
channel=${2:-'ch_teste'}
to=${3:-60}
content="This is Spartaaaaaaa id=$id!!!"
post_data="
{
Expand All @@ -14,4 +15,6 @@ post_data="
\"dtCreated\":\"$date\"
}"

curl -v "http://localhost:8080/broadcast/pub" -d "ch=$channel&m=$id&t=$date&to=60&rt_message=$post_data"
post_data="*** PAYLOAD $id/$channel ***"

curl -v "http://localhost:8080/broadcast/pub" -d "ch=$channel&m=$id&t=$date&to=$to&rt_message=$post_data"

0 comments on commit ce2746a

Please sign in to comment.