-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_endpoint.sh
102 lines (94 loc) · 2.55 KB
/
run_endpoint.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Set up the routing needed for the simulation.
/setup.sh
# The following variables are available for use:
# - ROLE contains the role of this execution context, client or server
# - SERVER_PARAMS contains user-supplied command line parameters
# - CLIENT_PARAMS contains user-supplied command line parameters
LOG_PARAMS=""
if [ -n "$QLOGDIR" ]; then
LOG_PARAMS="$LOG_PARAMS --quic-log $QLOGDIR"
fi
if [ -n "$SSLKEYLOGFILE" ]; then
LOG_PARAMS="$LOG_PARAMS --secrets-log $SSLKEYLOGFILE"
fi
if [ -n "$TESTCASE" ]; then
# interop runner
case "$TESTCASE" in
"chacha20")
CLIENT_PARAMS="--legacy-http --cipher-suites CHACHA20_POLY1305_SHA256"
;;
"handshake")
CLIENT_PARAMS="--legacy-http"
;;
"http3")
;;
"multiconnect")
CLIENT_PARAMS="--legacy-http"
;;
"resumption")
CLIENT_PARAMS="--legacy-http --session-ticket session.ticket"
;;
"retry")
CLIENT_PARAMS="--legacy-http"
SERVER_PARAMS="--retry"
;;
"transfer")
CLIENT_PARAMS="--legacy-http --max-data 262144 --max-stream-data 262144"
;;
"v2")
CLIENT_PARAMS="--legacy-http --negotiate-v2"
;;
"zerortt")
CLIENT_PARAMS="--legacy-http --session-ticket session.ticket --zero-rtt"
;;
*)
exit 127
;;
esac
if [ "$ROLE" = "server" ]; then
export STATIC_ROOT=/www
fi
else
# network simulator
REQUESTS="https://server/1000000"
fi
run_client() {
python3 examples/http3_client.py \
--insecure \
--output-dir /downloads \
--verbose \
$LOG_PARAMS \
$CLIENT_PARAMS \
$@ 2>> /logs/stderr.log
}
if [ "$ROLE" = "client" ]; then
# Wait for the simulator to start up.
/wait-for-it.sh sim:57832 -s -t 30
echo "Starting client"
case "$TESTCASE" in
"multiconnect")
for req in $REQUESTS; do
echo $req
run_client $req
done
;;
"resumption"|"zerortt")
arr=($REQUESTS)
run_client ${arr[0]}
run_client ${arr[@]:1}
;;
*)
run_client $REQUESTS
;;
esac
elif [ "$ROLE" = "server" ]; then
echo "Starting server"
python3 examples/http3_server.py \
--certificate /certs/cert.pem \
--port 443 \
--private-key /certs/priv.key \
--verbose \
$LOG_PARAMS \
$SERVER_PARAMS 2>> /logs/stderr.log
fi