consul: Check that ACL also allows registration

pull/506/head
Armon Dadgar 10 years ago
parent cafba93869
commit 4861e4d9e1

@ -50,7 +50,6 @@ func TestCatalogRegister_ACLDeny(t *testing.T) {
c.ACLDatacenter = "dc1" c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root" c.ACLMasterToken = "root"
c.ACLDefaultPolicy = "deny" c.ACLDefaultPolicy = "deny"
c.ACLToken = "root"
}) })
defer os.RemoveAll(dir1) defer os.RemoveAll(dir1)
defer s1.Shutdown() defer s1.Shutdown()
@ -93,6 +92,12 @@ func TestCatalogRegister_ACLDeny(t *testing.T) {
if err == nil || !strings.Contains(err.Error(), permissionDenied) { if err == nil || !strings.Contains(err.Error(), permissionDenied) {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
argR.Service.Service = "foo"
err = client.Call("Catalog.Register", &argR, &outR)
if err != nil {
t.Fatalf("err: %v", err)
}
} }
func TestCatalogRegister_ForwardLeader(t *testing.T) { func TestCatalogRegister_ForwardLeader(t *testing.T) {
@ -775,6 +780,6 @@ func TestCatalogRegister_FailedCase1(t *testing.T) {
var testRegisterRules = ` var testRegisterRules = `
service "foo" { service "foo" {
policy = "read" policy = "write"
} }
` `

Loading…
Cancel
Save