Skip to content

Commit

Permalink
test: simply the expected output for testCurlV3KVTxn
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Sep 11, 2023
1 parent 6544add commit 88f7290
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/v3_curl_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func testCurlV3Auth(cx ctlCtx) {
if err = e2e.CURLPost(cx.epc, e2e.CURLReq{
Endpoint: "/v3/kv/put",
Value: string(putreq),
Expected: expect.ExpectedResponse{Value: "error"},
Expected: expect.ExpectedResponse{Value: "etcdserver: user name is empty"},
}); err != nil {
cx.t.Fatalf("testCurlV3Auth failed to put without token (%v)", err)
}
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/v3_curl_election_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func testCurlV3ProclaimMissiongLeaderKey(cx ctlCtx) {
if err = e2e.CURLPost(cx.epc, e2e.CURLReq{
Endpoint: "/v3/election/proclaim",
Value: string(pdata),
Expected: expect.ExpectedResponse{Value: `{"error":"\"leader\" field must be provided","code":2,"message":"\"leader\" field must be provided"}`},
Expected: expect.ExpectedResponse{Value: `"message":"\"leader\" field must be provided"`},
}); err != nil {
cx.t.Fatalf("failed post proclaim request (%v)", err)
}
Expand All @@ -138,7 +138,7 @@ func testCurlV3ResignMissiongLeaderKey(cx ctlCtx) {
if err := e2e.CURLPost(cx.epc, e2e.CURLReq{
Endpoint: "/v3/election/resign",
Value: `{}`,
Expected: expect.ExpectedResponse{Value: `{"error":"\"leader\" field must be provided","code":2,"message":"\"leader\" field must be provided"}`},
Expected: expect.ExpectedResponse{Value: `"message":"\"leader\" field must be provided"`},
}); err != nil {
cx.t.Fatalf("failed post resign request (%v)", err)
}
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/v3_curl_kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func testCurlV3KVTxn(cx ctlCtx) {
jsonDat, jerr := m.Marshal(txn)
require.NoError(cx.t, jerr)

expected := `"succeeded":true,"responses":[{"response_put":{"header":{"revision":"2"}}}]`
expected := `"succeeded":true`
err := e2e.CURLPost(cx.epc, e2e.CURLReq{
Endpoint: "/v3/kv/txn",
Value: string(jsonDat),
Expand All @@ -168,7 +168,7 @@ func testCurlV3KVTxn(cx ctlCtx) {
err = e2e.CURLPost(cx.epc, e2e.CURLReq{
Endpoint: "/v3/kv/txn",
Value: malformed,
Expected: expect.ExpectedResponse{Value: "error"},
Expected: expect.ExpectedResponse{Value: "etcdserver: key not found"},
})
require.NoErrorf(cx.t, err, "testCurlV3Txn with malformed request failed")
}
Expand Down

0 comments on commit 88f7290

Please sign in to comment.