This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
forked from m-lab/neubot-support
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·73 lines (65 loc) · 1.54 KB
/
test.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
if [ "$#" -ne 2 ]; then
echo "usage: $0 <server> <parallelism>" 1>&2
exit 1
fi
# params:
max_runtime_min=30
test_server=$1; shift
parallel=$1; shift
clone() {
if [ ! -d `basename $1` ]; then
git clone --single-branch --depth 1 --branch $2 https://github.com/$1
fi
}
clone "neubot/neubot" "0.4.16.9"
clone "measurement-kit/measurement-kit" "stable"
# This assumes you have installed MK dependencies (libevent-dev, libssl-dev,
# and libgeoip-dev), you have a C++11 compiler etc.
(
if [ ! -x ./measurement-kit/measurement_kit ]; then
cd measurement-kit
./autogen.sh -n
./configure
make V=0 -j2
fi
)
child() {
max_runtime_sec=$(($max_runtime_min * 60))
begin=`date +%s`
while [ $((`date +%s` - $begin)) -lt $max_runtime_sec ]; do
(
cd neubot
./UNIX/bin/neubot speedtest -fA $test_server
)
(
cd neubot
./UNIX/bin/neubot bittorrent -fA $test_server
)
(
cd neubot
./UNIX/bin/neubot raw -fA $test_server
)
(
cd neubot
./UNIX/bin/neubot dash -fA $test_server
)
(
cd measurement-kit
./measurement_kit ndt -T download -T download-ext $test_server
)
(
cd measurement-kit
./measurement_kit dash $test_server
)
done
}
trap 'kill $(jobs -p)' EXIT
set +e
count=1
while [ $count -lt $parallel ]; do
child &
count=$(($count + 1))
done
child