Skip to content

Commit

Permalink
e2e: test issue 5246
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho committed May 4, 2016
1 parent ed63b4c commit 5d358a3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions e2e/v2_curl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,29 @@ func TestV2CurlIssue5182(t *testing.T) {
}
}

func TestV2CurlIssue5246(t *testing.T) {
defer testutil.AfterTest(t)

epc := setupEtcdctlTest(t, &configNoTLS, false)
defer func() {
if err := epc.Close(); err != nil {
t.Fatalf("error closing etcd processes (%v)", err)
}
}()

if err := etcdctlUserAdd(epc, "root", "a"); err != nil {
t.Fatal(err)
}
expectUserUpdate := `{"user":"root","roles":["foo"`
if err := cURLPut(epc, cURLReq{endpoint: "/v2/auth/users/root", value: `{"user": "root", "grant": ["foo"]}`, expected: expectUserUpdate}); err != nil {
t.Fatal(err)
}
expectUsersRole := `{"users":[{"user":"root","roles":[{"role":"root"`
if err := cURLGet(epc, cURLReq{endpoint: "/v2/auth/users", username: "root", password: "", expected: expectUsersRole}); err != nil {
t.Fatal(err)
}
}

type cURLReq struct {
username string
password string
Expand Down

0 comments on commit 5d358a3

Please sign in to comment.