tris: add picotls interop

This commit is contained in:
Filippo Valsorda 2016-11-26 05:50:26 +00:00 committed by Peter Wu
parent f8c15889af
commit 6ca044cede
5 changed files with 45 additions and 8 deletions

View File

@ -10,19 +10,20 @@ go:
env: env:
- MODE=interop CLIENT=boring - MODE=interop CLIENT=boring
- MODE=interop CLIENT=bogo - MODE=interop CLIENT=bogo
- MODE=interop CLIENT=tstclnt - MODE=interop CLIENT=tstclnt # added while ZRTT=1 is broken
- MODE=interop CLIENT=picotls ZRTT=1
- MODE=interop CLIENT=mint - MODE=interop CLIENT=mint
- MODE=gotest - MODE=gotest
- MODE=interop CLIENT=tstclnt ZRTT=1
- MODE=interop CLIENT=boring REVISION=origin/master - MODE=interop CLIENT=boring REVISION=origin/master
- MODE=interop CLIENT=bogo REVISION=origin/master - MODE=interop CLIENT=tstclnt REVISION=default ZRTT=1
- MODE=interop CLIENT=tstclnt REVISION=default
matrix: matrix:
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- env: MODE=interop CLIENT=boring REVISION=origin/master - env: MODE=interop CLIENT=boring REVISION=origin/master
- env: MODE=interop CLIENT=bogo REVISION=origin/master - env: MODE=interop CLIENT=tstclnt ZRTT=1 # tstclnt races and doesn't resend
- env: MODE=interop CLIENT=tstclnt REVISION=default - env: MODE=interop CLIENT=tstclnt REVISION=default ZRTT=1
- env: MODE=interop CLIENT=mint # broken resumption client - env: MODE=interop CLIENT=mint # broken resumption client
install: install:
@ -31,7 +32,7 @@ install:
script: script:
- if [ "$MODE" = "interop" ]; then ./_dev/interop.sh RUN $CLIENT; fi - if [ "$MODE" = "interop" ]; then ./_dev/interop.sh RUN $CLIENT; fi
- if [ "$MODE" = "interop" ] && [ "$CLIENT" = "tstclnt" ]; then ./_dev/interop.sh 0-RTT $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" = "gotest" ]; then ./_dev/go.sh test -race crypto/tls; fi
after_script: after_script:

21
_dev/picotls/Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM alpine
RUN apk add --update \
git \
cmake \
build-base \
openssl-dev \
bash \
&& rm -rf /var/cache/apk/*
RUN git clone https://github.com/h2o/picotls
ARG REVISION=a6c1c65
RUN cd picotls && git fetch && git checkout $REVISION
RUN cd picotls && git submodule update --init
RUN cd picotls && cmake . && make
ADD httpreq.txt /httpreq.txt
ADD run.sh /run.sh
ENTRYPOINT ["/run.sh"]

5
_dev/picotls/httpreq.txt Normal file
View File

@ -0,0 +1,5 @@
GET / HTTP/1.1
Host: example.com
Connection: close

10
_dev/picotls/run.sh Executable file
View File

@ -0,0 +1,10 @@
#! /bin/bash
set -e
IFS=':' read -ra ADDR <<< "$1"
shift
HOST="${ADDR[0]}"
PORT="${ADDR[1]}"
/picotls/cli -s /session -e "$@" $HOST $PORT < /httpreq.txt
/picotls/cli -s /session -e "$@" $HOST $PORT < /httpreq.txt

View File

@ -68,8 +68,8 @@ func (i opensslInput) Read(buf []byte) (n int, err error) {
// log message from a completed server handshake. // log message from a completed server handshake.
type opensslOutputSink struct { type opensslOutputSink struct {
handshakeConfirmed chan struct{} handshakeConfirmed chan struct{}
all []byte all []byte
line []byte line []byte
} }
func newOpensslOutputSink() *opensslOutputSink { func newOpensslOutputSink() *opensslOutputSink {