Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
1. Add space in the expected response;
2. HTTP 1.0 isn't supported when TLS is enabled.

Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Aug 24, 2023
1 parent ed1f97b commit 53fa88b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/e2e/cmux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/v3_curl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ 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)
}

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

Expand Down

0 comments on commit 53fa88b

Please sign in to comment.