From 53fa88b1012e1acb638072543234039a22031fdd Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Thu, 24 Aug 2023 15:50:31 +0100 Subject: [PATCH] Update test cases 1. Add space in the expected response; 2. HTTP 1.0 isn't supported when TLS is enabled. Signed-off-by: Benjamin Wang --- tests/e2e/cmux_test.go | 3 ++- tests/e2e/v3_curl_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/cmux_test.go b/tests/e2e/cmux_test.go index 89844093c788..e29f6db5f9db 100644 --- a/tests/e2e/cmux_test.go +++ b/tests/e2e/cmux_test.go @@ -121,7 +121,8 @@ func testConnectionMultiplexing(t *testing.T, ctx context.Context, member e2e.Et assert.NoError(t, err) }) t.Run("curl", func(t *testing.T) { - for _, httpVersion := range []string{"2", "1.1", "1.0", ""} { + // {"level":"warn","ts":"2023-08-24T15:38:39.717866+0100","caller":"embed/config_logging.go:187","msg":"rejected connection","remote-addr":"127.0.0.1:54246","server-name":"","error":"tls: client requested unsupported application protocols ([http/1.0])"} + for _, httpVersion := range []string{"2", "1.1", ""} { tname := "http" + httpVersion if httpVersion == "" { tname = "default" diff --git a/tests/e2e/v3_curl_test.go b/tests/e2e/v3_curl_test.go index ddd1da103dcd..4c9201415ae9 100644 --- a/tests/e2e/v3_curl_test.go +++ b/tests/e2e/v3_curl_test.go @@ -180,7 +180,7 @@ func testV3CurlTxn(cx ctlCtx) { if jerr != nil { cx.t.Fatal(jerr) } - expected := `"succeeded":true,"responses":[{"response_put":{"header":{"revision":"2"}}}]` + expected := `"succeeded":true, "responses":[{"response_put":{"header":{"revision":"2"}}}]` p := cx.apiPrefix if err := e2e.CURLPost(cx.epc, e2e.CURLReq{Endpoint: path.Join(p, "/kv/txn"), Value: string(jsonDat), Expected: expected}); err != nil { cx.t.Fatalf("failed testV3CurlTxn txn with curl using prefix (%s) (%v)", p, err) @@ -188,7 +188,7 @@ func testV3CurlTxn(cx ctlCtx) { // was crashing etcd server malformed := `{"compare":[{"result":0,"target":1,"key":"Zm9v","TargetUnion":null}],"success":[{"Request":{"RequestPut":{"key":"Zm9v","value":"YmFy"}}}]}` - if err := e2e.CURLPost(cx.epc, e2e.CURLReq{Endpoint: path.Join(p, "/kv/txn"), Value: malformed, Expected: `"code":3,"message":"etcdserver: key not found"`}); err != nil { + if err := e2e.CURLPost(cx.epc, e2e.CURLReq{Endpoint: path.Join(p, "/kv/txn"), Value: malformed, Expected: `"code":3, "message":"etcdserver: key not found"`}); err != nil { cx.t.Fatalf("failed testV3CurlTxn put with curl using prefix (%s) (%v)", p, err) }