forked from scionproto/scion
-
Notifications
You must be signed in to change notification settings - Fork 1
/
integration_test.sh
executable file
·77 lines (65 loc) · 1.52 KB
/
integration_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
74
75
76
77
#!/bin/bash
set -o pipefail
log() {
echo "========> ($(date -u --rfc-3339=seconds)) $@"
}
wait_startup() {
count=0
while true; do
log "Waiting for host ZK to be up (count:$count)"
{ echo "ruok" | nc localhost 2181 | grep -q 'imok'; } && break
count=$((count+1))
if [ $count -gt 20 ]; then
log "Host ZK failed to come up within 1 minute"
exit 1
fi
sleep 3
done
log "Host ZK up"
}
shutdown() {
log "Scion status:"
./scion.sh status
log "Stopping scion"
./scion.sh stop | grep -v "stopped"
log "Scion stopped"
}
run() {
log "${1:?}: starting"
time ${2:?}
result=$?
if [ $result -eq 0 ]; then
log "$1: success"
else
log "$1: failure"
fi
return $result
}
export -f run log
export PYTHONPATH=.
log "Starting scion (without building)"
./scion.sh run nobuild | grep -v "started"
log "Scion status:"
./scion.sh status || exit 1
sleep 5
cat << EOF | parallel --no-notice -n2 -j2 run
End2End
test/integration/end2end_test.py -l ERROR
C2S_extn
test/integration/cli_srv_ext_test.py -l ERROR
SCMP error
test/integration/scmp_error_test.py -l ERROR --runs 60
Cert/TRC request
test/integration/cert_req_test.py -l ERROR
EOF
result=$?
run Revocation "test/integration/revocation_test.sh\
${REV_BRS:-as1-11:br1-11-3 as2-26:br2-26-2 as1-14:br1-14-3 as1-16:br1-16-2}"
result=$((result+$?))
shutdown
if [ $result -eq 0 ]; then
log "All tests successful"
else
log "$result tests failed"
fi
exit $result