Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions codebuild/spec/buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
version: 0.2

env:
shell: bash
variables:
# ultraman requires $SHELL be set
SHELL: "/bin/bash"

phases:
install:
commands:
- echo "Installing Rust ..."
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- source $HOME/.cargo/env
- echo "Installing cmake ..."
- apt-get update -y
- apt-get install -y cmake
build:
commands:
- printenv
- echo "Running quic-attack for $RUNTIME seconds"
- ./scripts/quic-attack/run $RUNTIME
17 changes: 15 additions & 2 deletions scripts/quic-attack/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
set -e

# ensure s2n-quic-qns is built
RUSTFLAGS="-C debug_assertions --cfg s2n_internal_dev -g" cargo +stable build --release --bin s2n-quic-qns
# -C debug_assertions turns on debug assertions and overflow checks in the release build
# -g include debug information
# -C panic=abort will cause spawned tasks that panic to exit the process
RUSTFLAGS="-C debug_assertions --cfg s2n_internal_dev -g -C panic=abort" cargo +stable build --release --bin s2n-quic-qns

# ensure ultraman is installed
if ! command -v ultraman &> /dev/null; then
cargo install ultraman
cargo +stable install ultraman
fi

# The different types of fuzzing supported by quic-attack
Expand Down Expand Up @@ -55,7 +58,17 @@ fi
COMMON_ARGS="--max-throughput 10000 --max-handshake-duration 10 --max-idle-timeout 10"
PERF_APP="./target/release/s2n-quic-qns perf"

# disable exiting on errors to capture the timeout status
set +e
RUST_BACKTRACE=1 \
SERVER="$PERF_APP server $COMMON_ARGS" \
CLIENT="$PERF_APP client $COMMON_ARGS --ip 127.0.0.1 --local-ip 127.0.0.1 --connections 100000000000000000 --send 100000 --receive 100000 --streams 10000 --concurrency 1000" \
$TIMEOUT ultraman start --no-timestamp true -f ./scripts/quic-attack/Procfile -m $PROCESSES
EXIT_CODE="$?"
# cleanup any zombie processes
pkill -f "$PERF_APP"
# re-enable exiting on errors
set -e
# `timeout` exits with `124` if the time limit was reached
# only exit with a success code if the time limit was reached
[[ "$EXIT_CODE" == "124" ]] || exit 1