Handle goaway and http1 responses
diff --git a/tools/http2_interop/http2interop_test.go b/tools/http2_interop/http2interop_test.go
index e3d366f..b35d085 100644
--- a/tools/http2_interop/http2interop_test.go
+++ b/tools/http2_interop/http2interop_test.go
@@ -5,7 +5,6 @@
"crypto/x509"
"flag"
"fmt"
- "io"
"io/ioutil"
"os"
"strconv"
@@ -68,15 +67,25 @@
return nil
}
+func TestClientShortSettings(t *testing.T) {
+ if *testCase != "framing" {
+ t.SkipNow()
+ }
+ ctx := InteropCtx(t)
+ for i := 1; i <= 5; i++ {
+ err := testClientShortSettings(ctx, i)
+ matchError(t, err, "EOF")
+ }
+}
+
func TestShortPreface(t *testing.T) {
if *testCase != "framing" {
t.SkipNow()
}
ctx := InteropCtx(t)
for i := 0; i < len(Preface)-1; i++ {
- if err := testShortPreface(ctx, Preface[:i]+"X"); err != io.EOF {
- t.Error("Expected an EOF but was", err)
- }
+ err := testShortPreface(ctx, Preface[:i]+"X")
+ matchError(t, err, "EOF")
}
}
@@ -90,13 +99,22 @@
}
}
+func TestClientPrefaceWithStreamId(t *testing.T) {
+ if *testCase != "framing" {
+ t.SkipNow()
+ }
+ ctx := InteropCtx(t)
+ err := testClientPrefaceWithStreamId(ctx)
+ matchError(t, err, "EOF")
+}
+
func TestTLSApplicationProtocol(t *testing.T) {
if *testCase != "tls" {
t.SkipNow()
}
ctx := InteropCtx(t)
err := testTLSApplicationProtocol(ctx)
- matchError(t, err, "EOF")
+ matchError(t, err, "EOF", "broken pipe")
}
func TestTLSMaxVersion(t *testing.T) {
@@ -119,15 +137,6 @@
matchError(t, err, "EOF", "Got goaway frame")
}
-func TestClientPrefaceWithStreamId(t *testing.T) {
- if *testCase != "framing" {
- t.SkipNow()
- }
- ctx := InteropCtx(t)
- err := testClientPrefaceWithStreamId(ctx)
- matchError(t, err, "EOF")
-}
-
func matchError(t *testing.T, err error, matches ...string) {
if err == nil {
t.Fatal("Expected an error")