-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add my test.sh
script
#1802
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/env bash | ||
|
||
# This script builds the client and server binaries and runs them in a tmux | ||
# session side-by-side. The client connects to the server and the server | ||
# responds with a simple HTTP response. The client and server are run with | ||
# verbose logging and the qlog output is stored in a temporary directory. The | ||
# script also runs tcpdump to capture the packets exchanged between the client | ||
# and server. The script uses tmux to create a split terminal window to display | ||
# the qlog output and the packet capture. | ||
|
||
set -e | ||
|
||
cargo build --bin neqo-client --bin neqo-server | ||
|
||
tmp=$(mktemp -d) | ||
addr=127.0.0.1 | ||
port=4433 | ||
path=/20000 | ||
flags="--verbose --qlog-dir $tmp --use-old-http --alpn hq-interop --quic-version 1" | ||
if [ "$(uname -s)" != "Linux" ]; then | ||
iface=lo0 | ||
else | ||
iface=lo | ||
fi | ||
|
||
client="./target/debug/neqo-client $flags --output-dir $tmp --stats https://$addr:$port$path" | ||
server="SSLKEYLOGFILE=$tmp/test.tlskey ./target/debug/neqo-server $flags $addr:$port" | ||
|
||
tcpdump -U -i "$iface" -w "$tmp/test.pcap" host $addr and port $port >/dev/null 2>&1 & | ||
tcpdump_pid=$! | ||
|
||
tmux -CC \ | ||
set-option -g default-shell "$(which bash)" \; \ | ||
new-session "$client && kill -USR2 $tcpdump_pid && touch $tmp/done" \; \ | ||
split-window -h "$server" \; \ | ||
split-window -v -f "\ | ||
until [ -e $tmp/done ]; do sleep 1; done && \ | ||
tshark -r $tmp/test.pcap -o tls.keylog_file:$tmp/test.tlskey" \; \ | ||
set remain-on-exit on | ||
|
||
# rm -rf "$tmp" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably use
trap 'rm -rf "$tmp"' EXIT
instead. Especially withset -e
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! #1810