Skip to content
Snippets Groups Projects
Commit 201d6e13 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Merge pull request #4161 from carl-mastrangelo/moreInterop1

Add framing http2 test case, enable verbose output, and properly skip tests
parents 2440f07d 59096b40
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ var ( ...@@ -17,7 +17,7 @@ var (
serverHost = flag.String("server_host", "", "The host to test") serverHost = flag.String("server_host", "", "The host to test")
serverPort = flag.Int("server_port", 443, "The port to test") serverPort = flag.Int("server_port", 443, "The port to test")
useTls = flag.Bool("use_tls", true, "Should TLS tests be run") useTls = flag.Bool("use_tls", true, "Should TLS tests be run")
testCase = flag.String("test_case", "", "What test cases to run") testCase = flag.String("test_case", "", "What test cases to run (tls, framing)")
// The rest of these are unused, but present to fulfill the client interface // The rest of these are unused, but present to fulfill the client interface
serverHostOverride = flag.String("server_host_override", "", "Unused") serverHostOverride = flag.String("server_host_override", "", "Unused")
...@@ -69,6 +69,9 @@ func (ctx *HTTP2InteropCtx) Close() error { ...@@ -69,6 +69,9 @@ func (ctx *HTTP2InteropCtx) Close() error {
} }
func TestShortPreface(t *testing.T) { func TestShortPreface(t *testing.T) {
if *testCase != "framing" {
t.SkipNow()
}
ctx := InteropCtx(t) ctx := InteropCtx(t)
for i := 0; i < len(Preface)-1; i++ { for i := 0; i < len(Preface)-1; i++ {
if err := testShortPreface(ctx, Preface[:i]+"X"); err != io.EOF { if err := testShortPreface(ctx, Preface[:i]+"X"); err != io.EOF {
...@@ -78,6 +81,9 @@ func TestShortPreface(t *testing.T) { ...@@ -78,6 +81,9 @@ func TestShortPreface(t *testing.T) {
} }
func TestUnknownFrameType(t *testing.T) { func TestUnknownFrameType(t *testing.T) {
if *testCase != "framing" {
t.SkipNow()
}
ctx := InteropCtx(t) ctx := InteropCtx(t)
if err := testUnknownFrameType(ctx); err != nil { if err := testUnknownFrameType(ctx); err != nil {
t.Fatal(err) t.Fatal(err)
...@@ -86,7 +92,7 @@ func TestUnknownFrameType(t *testing.T) { ...@@ -86,7 +92,7 @@ func TestUnknownFrameType(t *testing.T) {
func TestTLSApplicationProtocol(t *testing.T) { func TestTLSApplicationProtocol(t *testing.T) {
if *testCase != "tls" { if *testCase != "tls" {
return t.SkipNow()
} }
ctx := InteropCtx(t) ctx := InteropCtx(t)
err := testTLSApplicationProtocol(ctx) err := testTLSApplicationProtocol(ctx)
...@@ -95,7 +101,7 @@ func TestTLSApplicationProtocol(t *testing.T) { ...@@ -95,7 +101,7 @@ func TestTLSApplicationProtocol(t *testing.T) {
func TestTLSMaxVersion(t *testing.T) { func TestTLSMaxVersion(t *testing.T) {
if *testCase != "tls" { if *testCase != "tls" {
return t.SkipNow()
} }
ctx := InteropCtx(t) ctx := InteropCtx(t)
err := testTLSMaxVersion(ctx, tls.VersionTLS11) err := testTLSMaxVersion(ctx, tls.VersionTLS11)
...@@ -106,7 +112,7 @@ func TestTLSMaxVersion(t *testing.T) { ...@@ -106,7 +112,7 @@ func TestTLSMaxVersion(t *testing.T) {
func TestTLSBadCipherSuites(t *testing.T) { func TestTLSBadCipherSuites(t *testing.T) {
if *testCase != "tls" { if *testCase != "tls" {
return t.SkipNow()
} }
ctx := InteropCtx(t) ctx := InteropCtx(t)
err := testTLSBadCipherSuites(ctx) err := testTLSBadCipherSuites(ctx)
...@@ -114,6 +120,9 @@ func TestTLSBadCipherSuites(t *testing.T) { ...@@ -114,6 +120,9 @@ func TestTLSBadCipherSuites(t *testing.T) {
} }
func TestClientPrefaceWithStreamId(t *testing.T) { func TestClientPrefaceWithStreamId(t *testing.T) {
if *testCase != "framing" {
t.SkipNow()
}
ctx := InteropCtx(t) ctx := InteropCtx(t)
err := testClientPrefaceWithStreamId(ctx) err := testClientPrefaceWithStreamId(ctx)
matchError(t, err, "EOF") matchError(t, err, "EOF")
......
...@@ -169,7 +169,7 @@ class Http2Client: ...@@ -169,7 +169,7 @@ class Http2Client:
self.safename = str(self) self.safename = str(self)
def client_args(self): def client_args(self):
return ['tools/http2_interop/http2_interop.test'] return ['tools/http2_interop/http2_interop.test', '-test.v']
def cloud_to_prod_env(self): def cloud_to_prod_env(self):
return {} return {}
...@@ -305,7 +305,7 @@ _TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong', ...@@ -305,7 +305,7 @@ _TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong',
_AUTH_TEST_CASES = ['compute_engine_creds', 'jwt_token_creds', _AUTH_TEST_CASES = ['compute_engine_creds', 'jwt_token_creds',
'oauth2_auth_token', 'per_rpc_creds'] 'oauth2_auth_token', 'per_rpc_creds']
_HTTP2_TEST_CASES = ["tls"] _HTTP2_TEST_CASES = ["tls", "framing"]
def docker_run_cmdline(cmdline, image, docker_args=[], cwd=None, environ=None): def docker_run_cmdline(cmdline, image, docker_args=[], cwd=None, environ=None):
"""Wraps given cmdline array to create 'docker run' cmdline from it.""" """Wraps given cmdline array to create 'docker run' cmdline from it."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment