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
516cleanup () {
@@ -22,9 +33,6 @@ cleanup () {
2233
2334trap 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" }
2836PROXY_PORT=1234
2937SERVER_PORT=4321
3038KEY_UPDATE_SIZE=35
@@ -122,17 +130,21 @@ EOF
122130echo " Starting capture"
123131tcpdump -i lo -n port ${SERVER_PORT} -w ./dtls${DTLS_VERSION} .pcap -U &
124132TCPDUMP_PID=$!
133+ sleep 0.5
125134
126135test_dropping_packets
127136test_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
132142fi
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
137149fi
138150
0 commit comments