diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 07:30:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 07:30:55 +0000 |
commit | 17e81f2cd1843f01838245eae7b5ed5edf83d6be (patch) | |
tree | a0f685dff11ce5a2dc546a7b46a48bae5d1c0140 /interop | |
parent | Initial commit. (diff) | |
download | ngtcp2-17e81f2cd1843f01838245eae7b5ed5edf83d6be.tar.xz ngtcp2-17e81f2cd1843f01838245eae7b5ed5edf83d6be.zip |
Adding upstream version 0.12.1+dfsg.upstream/0.12.1+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'interop')
-rw-r--r-- | interop/Dockerfile | 39 | ||||
-rw-r--r-- | interop/run_endpoint.sh | 86 |
2 files changed, 125 insertions, 0 deletions
diff --git a/interop/Dockerfile b/interop/Dockerfile new file mode 100644 index 0000000..c5703c0 --- /dev/null +++ b/interop/Dockerfile @@ -0,0 +1,39 @@ +FROM martenseemann/quic-network-simulator-endpoint:latest + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git gcc clang-12 make binutils autoconf automake autotools-dev libtool \ + pkg-config libev-dev libjemalloc-dev \ + libev4 libjemalloc2 ca-certificates mime-support \ + llvm-12 libasan5 libubsan1 && \ + git clone --depth 1 -b OpenSSL_1_1_1s+quic https://github.com/quictls/openssl && \ + cd openssl && ./config --openssldir=/etc/ssl && make -j$(nproc) && make install_sw && cd .. && rm -rf openssl && \ + git clone --depth 1 https://github.com/ngtcp2/nghttp3 && \ + cd nghttp3 && autoreconf -i && \ + ./configure --enable-lib-only \ + CC=clang-12 \ + CXX=clang++-12 \ + LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined" \ + CPPFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined -g3" && \ + make -j$(nproc) && make install && cd .. && rm -rf nghttp3 && \ + git clone --depth 1 https://github.com/ngtcp2/ngtcp2 && \ + cd ngtcp2 && autoreconf -i && \ + ./configure \ + CC=clang-12 \ + CXX=clang++-12 \ + LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined" \ + CPPFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined -g3" && \ + make -j$(nproc) && make install && \ + cp examples/server examples/client examples/h09server examples/h09client /usr/local/bin && \ + cd .. && \ + rm -rf ngtcp2 && \ + rm -rf /usr/local/lib/libssl.so /usr/local/lib/libcrypto.so /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a /usr/local/lib/pkgconfig/*ssl.pc /usr/local/include/openssl/* && \ + apt-get -y purge git g++ clang-12 make binutils autoconf automake \ + autotools-dev libtool pkg-config \ + libev-dev libjemalloc-dev && \ + apt-get -y autoremove --purge && \ + rm -rf /var/log/* + +COPY run_endpoint.sh . +RUN chmod +x run_endpoint.sh +ENTRYPOINT [ "./run_endpoint.sh" ] diff --git a/interop/run_endpoint.sh b/interop/run_endpoint.sh new file mode 100644 index 0000000..780c825 --- /dev/null +++ b/interop/run_endpoint.sh @@ -0,0 +1,86 @@ +#!/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 + +case $TESTCASE in + versionnegotiation|handshake|transfer|retry|resumption|http3|multiconnect|zerortt|chacha20|keyupdate|ecn|v2) + : + ;; + *) + exit 127 + ;; +esac + +LOG=/logs/log.txt + +if [ "$ROLE" == "client" ]; then + # Wait for the simulator to start up. + /wait-for-it.sh sim:57832 -s -t 30 + REQS=($REQUESTS) + SERVER=$(echo ${REQS[0]} | sed -re 's|^https://([^/:]+)(:[0-9]+)?/.*$|\1|') + if [ "$TESTCASE" == "http3" ]; then + CLIENT_BIN="/usr/local/bin/client" + else + CLIENT_BIN="/usr/local/bin/h09client" + fi + CLIENT_ARGS="$SERVER 443 --download /downloads -s --no-quic-dump --no-http-dump --exit-on-all-streams-close --qlog-dir $QLOGDIR --cc bbr2" + if [ "$TESTCASE" == "versionnegotiation" ]; then + CLIENT_ARGS="$CLIENT_ARGS -v 0xaaaaaaaa" + else + CLIENT_ARGS="$CLIENT_ARGS -v 0x1" + fi + if [ "$TESTCASE" == "chacha20" ]; then + CLIENT_ARGS="$CLIENT_ARGS --ciphers=TLS_CHACHA20_POLY1305_SHA256" + fi + if [ "$TESTCASE" == "keyupdate" ]; then + CLIENT_ARGS="$CLIENT_ARGS --delay-stream 10ms --key-update 1ms" + fi + if [ "$TESTCASE" == "v2" ]; then + CLIENT_ARGS="$CLIENT_ARGS --other-versions v2draft,v1" + fi + if [ "$TESTCASE" == "ecn" ]; then + CLIENT_ARGS="$CLIENT_ARGS --no-pmtud" + fi + if [ "$TESTCASE" == "resumption" ] || [ "$TESTCASE" == "zerortt" ]; then + CLIENT_ARGS="$CLIENT_ARGS --session-file session.txt --tp-file tp.txt" + if [ "$TESTCASE" == "resumption" ]; then + CLIENT_ARGS="$CLIENT_ARGS --disable-early-data" + fi + REQUESTS=${REQS[0]} + $CLIENT_BIN $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &> $LOG + REQUESTS=${REQS[@]:1} + $CLIENT_BIN $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &>> $LOG + elif [ "$TESTCASE" == "multiconnect" ]; then + CLIENT_ARGS="$CLIENT_ARGS --timeout=180s --handshake-timeout=180s" + for REQ in $REQUESTS; do + echo "multiconnect REQ: $REQ" >> $LOG + $CLIENT_BIN $CLIENT_ARGS $REQ $CLIENT_PARAMS &>> $LOG + done + else + $CLIENT_BIN $CLIENT_ARGS $REQUESTS $CLIENT_PARAMS &> $LOG + fi +elif [ "$ROLE" == "server" ]; then + if [ "$TESTCASE" == "http3" ]; then + SERVER_BIN="/usr/local/bin/server" + else + SERVER_BIN="/usr/local/bin/h09server" + fi + SERVER_ARGS="/certs/priv.key /certs/cert.pem -s -d /www --qlog-dir $QLOGDIR --cc bbr2" + if [ "$TESTCASE" == "retry" ]; then + SERVER_ARGS="$SERVER_ARGS -V" + elif [ "$TESTCASE" == "multiconnect" ]; then + SERVER_ARGS="$SERVER_ARGS --timeout=180s --handshake-timeout=180s" + elif [ "$TESTCASE" == "v2" ]; then + SERVER_ARGS="$SERVER_ARGS --preferred-versions v2draft" + elif [ "$TESTCASE" == "ecn" ]; then + SERVER_ARGS="$SERVER_ARGS --no-pmtud" + fi + + $SERVER_BIN '*' 443 $SERVER_ARGS $SERVER_PARAMS &> $LOG +fi |