tris: add proper BoGo tests

This commit is contained in:
Filippo Valsorda 2017-01-18 18:59:59 +00:00 committed by Peter Wu
부모 c758567785
커밋 6bff168a06
5개의 변경된 파일16개의 추가작업 그리고 64개의 파일을 삭제

파일 보기

@ -9,10 +9,10 @@ go:
env:
- MODE=interop CLIENT=boring
- MODE=interop CLIENT=bogo
- MODE=interop CLIENT=tstclnt
- MODE=interop CLIENT=picotls ZRTT=1
- MODE=interop CLIENT=mint
- MODE=bogo
- MODE=gotest
- MODE=interop CLIENT=tstclnt ZRTT=1
- MODE=interop CLIENT=boring REVISION=origin/master
@ -33,6 +33,7 @@ script:
- if [ "$MODE" = "interop" ]; then ./_dev/interop.sh RUN $CLIENT; fi
- if [ "$MODE" = "interop" ] && [ "$ZRTT" = "1" ]; then ./_dev/interop.sh 0-RTT $CLIENT; fi
- if [ "$MODE" = "gotest" ]; then ./_dev/go.sh test -race crypto/tls; fi
- if [ "$MODE" = "bogo" ]; then ./_dev/bogo.sh; fi
after_script:
- if [ "$MODE" = "interop" ]; then docker ps -a; docker logs tris-localserver; fi

7
_dev/bogo.sh Executable file
파일 보기

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -xeuo pipefail
BASEDIR=$(cd "$(dirname "$0")" && pwd)
docker build -t tls-tris:bogo _dev/bogo
docker run --rm -v $BASEDIR/..:/go/src/github.com/cloudflare/tls-tris tls-tris:bogo

파일 보기

@ -1,25 +1,13 @@
FROM alpine
FROM golang:1.7-alpine
RUN apk add --update \
git \
cmake \
perl \
python \
build-base \
go \
ninja \
make \
bash \
&& rm -rf /var/cache/apk/*
RUN git clone https://boringssl.googlesource.com/boringssl
ENV CGO_ENABLED=0
# see _dev/boring for REVISION info
ARG REVISION=9b885c5
RUN cd boringssl && git fetch
RUN cd boringssl && git checkout $REVISION
ADD bogo-client.go /bogo-client.go
RUN go build /bogo-client.go
ADD run.sh /run.sh
ENTRYPOINT ["/run.sh"]
RUN go get -d github.com/FiloSottile/crypto-tls-bogo-shim
WORKDIR /go/src/github.com/FiloSottile/crypto-tls-bogo-shim
CMD ["make", "run"]

파일 보기

@ -1,41 +0,0 @@
package main
import (
"log"
"net"
"net/http"
"os"
"./boringssl/ssl/test/runner"
)
func main() {
sessionCache := runner.NewLRUClientSessionCache(10)
tr := &http.Transport{
DialTLS: func(network, addr string) (net.Conn, error) {
return runner.Dial(network, addr, &runner.Config{
InsecureSkipVerify: true,
ClientSessionCache: sessionCache,
})
},
DisableKeepAlives: true,
}
client := &http.Client{Transport: tr}
resp, err := client.Get("https://" + os.Args[1])
if err != nil {
log.Fatal(err)
}
if err := resp.Write(os.Stdout); err != nil {
log.Fatal(err)
}
// Resumption
resp, err = client.Get("https://" + os.Args[1])
if err != nil {
log.Fatal(err)
}
if err := resp.Write(os.Stdout); err != nil {
log.Fatal(err)
}
}

파일 보기

@ -1,3 +0,0 @@
#! /bin/sh
exec /bogo-client "$@"