zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #650: ZOOKEEPER-1908: setAcl should be have a recursi...
Date Tue, 02 Oct 2018 12:06:50 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/650#discussion_r221899955
  
    --- Diff: src/java/test/org/apache/zookeeper/ZooKeeperTest.java ---
    @@ -566,4 +566,25 @@ public void testLsrNonexistantZnodeCommand() throws Exception {
                 Assert.assertEquals(KeeperException.Code.NONODE, ((KeeperException)e.getCause()).code());
             }
         }
    +
    +    public void testSetAclRecursive() throws Exception {
    +        final ZooKeeper zk = createClient();
    +        final byte[] EMPTY = new byte[0];
    +
    +        zk.setData("/", EMPTY, -1);
    +        zk.create("/a", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    +        zk.create("/a/b", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    +        zk.create("/a/b/c", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    +        zk.create("/a/d", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    +
    +        ZooKeeperMain zkMain = new ZooKeeperMain(zk);
    +        String setAclCommand = "setAcl -R /a world:anyone:r";
    +        zkMain.cl.parseCommand(setAclCommand);
    +        Assert.assertFalse(zkMain.processZKCmd(zkMain.cl));
    +
    +        Assert.assertEquals(zk.getACL("/a", new Stat()), Ids.READ_ACL_UNSAFE);
    --- End diff --
    
    Parameter order should be the other way around, right?
    Expected value first, the actual second.
    A short description would also be useful.


---

Mime
View raw message