Browse Source

consul: Check that ACL also allows registration

pull/506/head
Armon Dadgar 10 years ago
parent
commit
4861e4d9e1
  1. 9
      consul/catalog_endpoint_test.go

9
consul/catalog_endpoint_test.go

@ -50,7 +50,6 @@ func TestCatalogRegister_ACLDeny(t *testing.T) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
c.ACLDefaultPolicy = "deny"
c.ACLToken = "root"
})
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -93,6 +92,12 @@ func TestCatalogRegister_ACLDeny(t *testing.T) {
if err == nil || !strings.Contains(err.Error(), permissionDenied) {
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) {
@ -775,6 +780,6 @@ func TestCatalogRegister_FailedCase1(t *testing.T) {
var testRegisterRules = `
service "foo" {
policy = "read"
policy = "write"
}
`

Loading…
Cancel
Save