Skip to content

Commit 9a00760

Browse files
author
Andras Fekete
committed
Usage documentation
1 parent bea1b6f commit 9a00760

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

scripts/dtls.test

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/bash
22

3+
# This script can be run with several environment variables set dictating its
4+
# run. You can set the following to what you like:
5+
WOLFSSL_ROOT=${WOLFSSL_ROOT:-$(pwd)}
6+
UDP_PROXY_BIN=${UDP_PROXY_BIN:-"udp_proxy"}
7+
DTLS_VERSION=${DTLS_VERSION:-"-v4"}
8+
# Additionally, you can add the following tests by setting it to '1':
9+
DO_EXTENDED_SERVER_PERMUTATION_TEST=${DO_EXTENDED_SERVER_PERMUTATION_TEST:-0}
10+
DO_DELAY_TEST=${DO_DELAY_TEST:-0}
11+
12+
# An example use would be: DTLS_VERSION=-v3 scripts/dtls.test
13+
314
#set -x # enable debug output
415

516
cleanup () {
@@ -22,9 +33,6 @@ cleanup () {
2233

2334
trap cleanup err exit
2435

25-
WOLFSSL_ROOT=${WOLFSSL_ROOT:-$(pwd)}
26-
UDP_PROXY_BIN=${UDP_PROXY_BIN:-"udp_proxy"}
27-
DTLS_VERSION=${DTLS_VERSION:-"-v4"}
2836
PROXY_PORT=1234
2937
SERVER_PORT=4321
3038
KEY_UPDATE_SIZE=35
@@ -122,17 +130,21 @@ EOF
122130
echo "Starting capture"
123131
tcpdump -i lo -n port ${SERVER_PORT} -w ./dtls${DTLS_VERSION}.pcap -U &
124132
TCPDUMP_PID=$!
133+
sleep 0.5
125134

126135
test_dropping_packets
127136
test_permutations client 012
128-
test_dropping_new_session_ticket 200
129137

130-
if [ ! -z $DO_SERVER_PERMUTATION_TEST ];then
138+
if [ "$DO_EXTENDED_SERVER_PERMUTATION_TEST" = "1" ];then
131139
test_permutations server 0123456
140+
else
141+
test_permutations server 012
132142
fi
133143

144+
test_dropping_new_session_ticket 200
145+
134146
# TODO: fix udp_proxy to not re-order close alert before app data
135-
if [ ! -z $DO_DELAY_TEST ];then
147+
if [ "$DO_DELAY_TEST" = "1" ];then
136148
test_time_delays
137149
fi
138150

0 commit comments

Comments
 (0)