-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
172 additions
and
952 deletions.
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 |
---|---|---|
@@ -1,80 +1,45 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: [push] | ||
|
||
env: | ||
PIPING_SERVER_CHECK_VERSION: 0.7.1 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.19 | ||
- name: Build | ||
run: CGO_ENABLED=0 go build -o go-piping-server main/main.go | ||
- name: Test | ||
run: go test -v ./... | ||
|
||
linux_operational_test: | ||
runs-on: ubuntu-18.04 | ||
linux_piping_server_check: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.19 | ||
- name: Build | ||
run: CGO_ENABLED=0 go build -o go-piping-server main/main.go | ||
- name: Operational test | ||
run: | | ||
set -xeu | ||
# Create certificates | ||
mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/' && cd - | ||
# Run a server | ||
./go-piping-server --http-port=8181 --enable-https --https-port=8443 --crt-path=./ssl_certs/server.crt --key-path=./ssl_certs/server.key &> ./piping-server.log & | ||
# Get server PID | ||
server_pid=$! | ||
sleep 3 | ||
# Transfer data over HTTP | ||
echo "hello, world" | curl -T - localhost:8181/mypath & | ||
diff <(echo "hello, world") <(curl localhost:8181/mypath) | ||
# Make a large random file | ||
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat | ||
# Transfer large data over HTTP | ||
cat /tmp/500M.dat | curl -T - localhost:8181/mypath & | ||
diff <(cat /tmp/500M.dat) <(curl localhost:8181/mypath) | ||
rm /tmp/500M.dat | ||
# Transfer data over HTTPS | ||
echo "hello, world with HTTPS" | curl -kT - https://localhost:8443/mypath2 & | ||
diff <(echo "hello, world with HTTPS") <(curl -k https://localhost:8443/mypath2) | ||
# Make a large random file | ||
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat | ||
# Transfer large data over HTTPS | ||
cat /tmp/500M.dat | curl -kT - https://localhost:8443/mypath2 & | ||
diff <(cat /tmp/500M.dat) <(curl -k https://localhost:8443/mypath2) | ||
rm /tmp/500M.dat | ||
# HTTP/2 support | ||
(echo hello | curl -ksST- https://localhost:8443/mypath3 -o /dev/null -w '%{http_version}:%{http_code}\n' > /tmp/http2_post.txt) & | ||
diff <(echo '2:200') <(curl -ksS https://localhost:8443/mypath3 -o /dev/null -w '%{http_version}:%{http_code}\n') | ||
diff <(echo '2:200') /tmp/http2_post.txt | ||
# Transfer data using multipart | ||
# Make a large random file | ||
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat | ||
# Transfer large data over HTTP | ||
curl -F myfile=@/tmp/500M.dat localhost:8181/mypath3 & | ||
diff <(cat /tmp/500M.dat) <(curl localhost:8181/mypath3) | ||
rm /tmp/500M.dat | ||
# Stop the server | ||
kill $server_pid | ||
# Print server's log | ||
cat ./piping-server.log | ||
- name: Create certificates | ||
run: cd /tmp && mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/' && cd - | ||
- name: Install piping-server-check | ||
run: cd /tmp && wget -O piping-server-check.deb https://github.com/nwtgck/piping-server-check/releases/download/v${PIPING_SERVER_CHECK_VERSION}/piping-server-check-${PIPING_SERVER_CHECK_VERSION}-linux-amd64.deb && sudo dpkg -i piping-server-check.deb | ||
- name: piping-server-check | ||
# sometimes .same_path_sender_rejection subcheck fails (why?) | ||
# TODO: add --http1.0-tls | ||
run: piping-server-check --http1.0 --http1.1 --http1.1-tls --h2c --h2 --h3 --tls-skip-verify --concurrency 100 --compromise post_first_byte_by_byte_streaming --compromise post_first.same_path_sender_rejection --compromise put.same_path_sender_rejection --compromise http1.0/multipart_form_data --compromise http1.0-tls/multipart_form_data --server-command='mkdir -p /tmp/logs && ./go-piping-server --http-port=$HTTP_PORT --enable-https --enable-http3 --https-port=$HTTPS_PORT --crt-path=/tmp/ssl_certs/server.crt --key-path=/tmp/ssl_certs/server.key 2>&1 | tee /tmp/logs/$(date "+%s%3N").log > /dev/stderr' --transfer-speed-byte $((1024 * 1024 * 1024 * 1024)) --transfer-span 3s --transfer-span 10s | ||
timeout-minutes: 1 | ||
- name: Show server logs from piping-server-check | ||
run: cat /tmp/logs/* |
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
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
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
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
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
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 |
---|---|---|
@@ -1,10 +1,29 @@ | ||
module github.com/nwtgck/go-piping-server | ||
|
||
go 1.16 | ||
go 1.19 | ||
|
||
require ( | ||
github.com/lucas-clemente/quic-go v0.24.0 | ||
github.com/spf13/cobra v1.3.0 | ||
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d | ||
gotest.tools/v3 v3.0.3 | ||
github.com/lucas-clemente/quic-go v0.31.1 | ||
github.com/spf13/cobra v1.6.1 | ||
golang.org/x/net v0.8.0 | ||
gotest.tools/v3 v3.4.0 | ||
) | ||
|
||
require ( | ||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect | ||
github.com/golang/mock v1.6.0 // indirect | ||
github.com/google/go-cmp v0.5.8 // indirect | ||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.1 // indirect | ||
github.com/marten-seemann/qpack v0.3.0 // indirect | ||
github.com/marten-seemann/qtls-go1-18 v0.1.3 // indirect | ||
github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect | ||
github.com/onsi/ginkgo/v2 v2.2.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
golang.org/x/crypto v0.1.0 // indirect | ||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect | ||
golang.org/x/mod v0.8.0 // indirect | ||
golang.org/x/sys v0.6.0 // indirect | ||
golang.org/x/text v0.8.0 // indirect | ||
golang.org/x/tools v0.6.0 // indirect | ||
) |
Oops, something went wrong.