-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.coverage.sh
executable file
·87 lines (75 loc) · 1.93 KB
/
.coverage.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
set -e
# build with coverage
if [ -f Makefile ]; then
make distclean
fi
autoreconf -if
export CFLAGS="-fprofile-arcs -ftest-coverage"
./configure --enable-debug
make
# run tests
src/muon || true
src/muon -h || true
src/muon --version || true
src/muon --invalid-option || true
cd tests
make test_encapsulate perf
cd ..
tests/test_encapsulate
tests/perf
# run real test
sudo mkdir -p /dev/net
[ -e /dev/net/tun ] || sudo mknod /dev/net/tun c 10 200
{
cat <<EOF
sudo mkdir -p /dev/net
[ -e /dev/net/tun ] || sudo mknod /dev/net/tun c 10 200
cd /tmp/
wget -O ./muon https://s3.pxx.io/snapshot/muon/muon-x86_64
chmod +x ./muon
iperf3 -s --daemon
EOF
} | ssh [email protected] 'sh -x'
# run client
scp tests/server.conf [email protected]:/tmp/
{
cat <<EOF
sudo /tmp/muon -c /tmp/server.conf --daemon --pidfile /run/muon.pid --logfile /var/log/muon.log
EOF
} | ssh [email protected] 'sh -x'
sudo src/muon -c tests/client.conf --daemon --pidfile /run/muon.pid --logfile /var/log/muon.log
sleep 2
sudo ping -i 0.001 -c 100 100.64.255.0
iperf3 -c 100.64.255.0
sudo pkill -USR1 muon
sudo pkill muon
{
cat <<EOF
sudo pkill muon
EOF
} | ssh [email protected] 'sh -x'
# run server
sed -i -e 's/10.16.0.32/10.16.0.30/g' tests/client.conf tests/server.conf
scp tests/client.conf [email protected]:/tmp/
{
cat <<EOF
sudo /tmp/muon -c /tmp/client.conf --daemon --pidfile /run/muon.pid --logfile /var/log/muon.log
EOF
} | ssh [email protected] 'sh -x'
sudo src/muon -c tests/server.conf --daemon --pidfile /run/muon.pid --logfile /var/log/muon.log
sleep 2
sudo ping -i 0.001 -c 100 100.64.255.1
iperf3 -c 100.64.255.1
sudo pkill -USR1 muon
sudo pkill muon
{
cat <<EOF
sudo pkill muon
sudo pkill iperf3
EOF
} | ssh [email protected] 'sh -x'
sed -i -e 's/10.16.0.30/10.16.0.32/g' tests/client.conf tests/server.conf
sudo chown jenkins:jenkins -R ./
# send coverage report to codecov.io
bash <(curl -s https://codecov.io/bash)