Browse Source

tris: add proper BoGo tests

v1.2.3
Filippo Valsorda 7 years ago
committed by Peter Wu
parent
commit
6bff168a06
5 changed files with 16 additions and 64 deletions
  1. +2
    -1
      .travis.yml
  2. +7
    -0
      _dev/bogo.sh
  3. +7
    -19
      _dev/bogo/Dockerfile
  4. +0
    -41
      _dev/bogo/bogo-client.go
  5. +0
    -3
      _dev/bogo/run.sh

+ 2
- 1
.travis.yml View File

@@ -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
- 0
_dev/bogo.sh View 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

+ 7
- 19
_dev/bogo/Dockerfile View File

@@ -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"]

+ 0
- 41
_dev/bogo/bogo-client.go View File

@@ -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)
}
}

+ 0
- 3
_dev/bogo/run.sh View File

@@ -1,3 +0,0 @@
#! /bin/sh

exec /bogo-client "$@"

Loading…
Cancel
Save