Exemple #1
0
        public virtual void TestUserZookeeperHomePathAccess()
        {
            RMRegistryOperationsService rmRegistryOperations = StartRMRegistryOperations();
            string home = rmRegistryOperations.InitUserRegistry(Zookeeper);

            Describe(Log, "Creating ZK client");
            RegistryOperations operations = zookeeperUGI.DoAs(new _PrivilegedExceptionAction_232
                                                                  (this));

            operations.List(home);
            string path = home + "/subpath";

            operations.Mknode(path, false);
            operations.Delete(path, true);
        }
Exemple #2
0
        public virtual void TestAlicePathRestrictedAnonAccess()
        {
            RMRegistryOperationsService rmRegistryOperations = StartRMRegistryOperations();
            string aliceHome = rmRegistryOperations.InitUserRegistry(Alice);

            Describe(Log, "Creating anonymous accessor");
            RegistryOperations anonOperations = RegistryOperationsFactory.CreateAnonymousInstance
                                                    (zkClientConf);

            AddToTeardown(anonOperations);
            anonOperations.Start();
            anonOperations.List(aliceHome);
            ExpectMkNodeFailure(anonOperations, aliceHome + "/anon");
            ExpectDeleteFailure(anonOperations, aliceHome, true);
        }
Exemple #3
0
        public virtual void TestUserHomedirsPermissionsRestricted()
        {
            // test that the /users/$user permissions are restricted
            RMRegistryOperationsService rmRegistryOperations = StartRMRegistryOperations();
            // create Alice's dir, so it should have an ACL for Alice
            string      home     = rmRegistryOperations.InitUserRegistry(Alice);
            IList <ACL> acls     = rmRegistryOperations.ZkGetACLS(home);
            ACL         aliceACL = null;

            foreach (ACL acl in acls)
            {
                Log.Info(RegistrySecurity.AclToString(acl));
                ID id = acl.GetId();
                if (id.GetScheme().Equals(ZookeeperConfigOptions.SchemeSasl) && id.GetId().StartsWith
                        (Alice))
                {
                    aliceACL = acl;
                    break;
                }
            }
            NUnit.Framework.Assert.IsNotNull(aliceACL);
            NUnit.Framework.Assert.AreEqual(RegistryAdminService.UserHomedirAclPermissions, aliceACL
                                            .GetPerms());
        }