Пример #1
0
 private static void BadAcl(string acls, string expectedErr)
 {
     try
     {
         ZKUtil.ParseACLs(acls);
         NUnit.Framework.Assert.Fail("Should have failed to parse '" + acls + "'");
     }
     catch (ZKUtil.BadAclFormatException e)
     {
         Assert.Equal(expectedErr, e.Message);
     }
 }
Пример #2
0
        public virtual void TestGoodACLs()
        {
            IList <ACL> result = ZKUtil.ParseACLs("sasl:hdfs/[email protected]:cdrwa, sasl:hdfs/[email protected]:ca"
                                                  );
            ACL acl0 = result[0];

            Assert.Equal(ZooDefs.Perms.Create | ZooDefs.Perms.Delete | ZooDefs.Perms
                         .Read | ZooDefs.Perms.Write | ZooDefs.Perms.Admin, acl0.GetPerms());
            Assert.Equal("sasl", acl0.GetId().GetScheme());
            Assert.Equal("hdfs/[email protected]", acl0.GetId().GetId());
            ACL acl1 = result[1];

            Assert.Equal(ZooDefs.Perms.Create | ZooDefs.Perms.Admin, acl1.
                         GetPerms());
            Assert.Equal("sasl", acl1.GetId().GetScheme());
            Assert.Equal("hdfs/[email protected]", acl1.GetId().GetId());
        }
Пример #3
0
        public virtual void TestNullACL()
        {
            IList <ACL> result = ZKUtil.ParseACLs(null);

            Assert.True(result.IsEmpty());
        }
Пример #4
0
        public virtual void TestEmptyACL()
        {
            IList <ACL> result = ZKUtil.ParseACLs(string.Empty);

            Assert.True(result.IsEmpty());
        }