-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests
executable file
·47 lines (36 loc) · 873 Bytes
/
runtests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
runtests () {
export numberOfUsers=$1
export totalEvents=$2
echo "Users = $1"
echo "Events = $2"
python follower-server.py &
{ ./followermaze.sh && echo "Test passed"; } || { echo "Test failed" && exit 1; }
}
# caveat emptor: minimally tested on GNU, works reliably on Mac OS X
cleanup () {
echo; echo "**********************************************************"; echo
ps -ef | grep -e "[Pp]ython [Ff]ollower-server.py" | awk '{print $2}' | xargs kill -9
}
logLevel=debug
# runtests $USERS $EVENTS
runtests 1 1
cleanup
# slightly more interesting
runtests 4 10
cleanup
# ever more slightly
runtests 10 100
cleanup
# barely scratching the surface
runtests 100 1000
cleanup
# this might hurt
runtests 1000 10000
cleanup
# hold on to your hats
unset numberOfUsers
unset totalEvents
python follower-server.py &
./followermaze.sh
cleanup