From 4861e4d9e19e7f34f3cdfcc58d3f6d2420a4694d Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sun, 30 Nov 2014 21:10:42 -0700 Subject: [PATCH] consul: Check that ACL also allows registration --- consul/catalog_endpoint_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/consul/catalog_endpoint_test.go b/consul/catalog_endpoint_test.go index 9c4e86ea9a..e2674f12b9 100644 --- a/consul/catalog_endpoint_test.go +++ b/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" } `