Skip to content

Commit

Permalink
e2e: test auth with guest access
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho committed Aug 1, 2016
1 parent cd22d09 commit a037588
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions e2e/ctl_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,30 @@ func TestCtlV2AuthWithCommonName(t *testing.T) {
}
}

func TestCtlV2AuthWithGuestRole(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 := etcdctlSet(epc, "foo", "bar"); err != nil {
t.Fatalf("failed to write (%v)", err)
}
if err := etcdctlUserAdd(epc, "root", "123"); err != nil {
t.Fatalf("failed to add user (%v)", err)
}
if err := etcdctlAuthEnable(epc); err != nil {
t.Fatalf("failed to enable auth (%v)", err)
}
if err := etcdctlGet(epc, "foo", "bar", false); err != nil {
t.Fatalf("failed to read (%v)", err)
}
}

func etcdctlPrefixArgs(clus *etcdProcessCluster) []string {
endpoints := ""
if proxies := clus.proxies(); len(proxies) != 0 {
Expand Down

0 comments on commit a037588

Please sign in to comment.