mirror of https://github.com/status-im/consul.git
consul: Check that ACL also allows registration
This commit is contained in:
parent
cafba93869
commit
4861e4d9e1
|
@ -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…
Reference in New Issue