Java Code Examples for org.apache.hadoop.registry.client.api.RegistryOperations#start()
The following examples show how to use
org.apache.hadoop.registry.client.api.RegistryOperations#start() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestSecureRMRegistryOperations.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testAnonReadAccess() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonReadAccess"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); assertFalse("RegistrySecurity.isClientSASLEnabled()==true", RegistrySecurity.isClientSASLEnabled()); operations.list(PATH_SYSTEM_SERVICES); }
Example 2
Source File: TestSecureRMRegistryOperations.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testAnonNoWriteAccess() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonNoWriteAccess"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); String servicePath = PATH_SYSTEM_SERVICES + "hdfs"; expectMkNodeFailure(operations, servicePath); }
Example 3
Source File: TestSecureRMRegistryOperations.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testAnonNoWriteAccessOffRoot() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonNoWriteAccessOffRoot"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); assertFalse("mknode(/)", operations.mknode("/", false)); expectMkNodeFailure(operations, "/sub"); expectDeleteFailure(operations, PATH_SYSTEM_SERVICES, true); }
Example 4
Source File: TestSecureRMRegistryOperations.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testAlicePathRestrictedAnonAccess() throws Throwable { 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); }
Example 5
Source File: TestSecureRMRegistryOperations.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testAnonReadAccess() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonReadAccess"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); assertFalse("RegistrySecurity.isClientSASLEnabled()==true", RegistrySecurity.isClientSASLEnabled()); operations.list(PATH_SYSTEM_SERVICES); }
Example 6
Source File: TestSecureRMRegistryOperations.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testAnonNoWriteAccess() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonNoWriteAccess"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); String servicePath = PATH_SYSTEM_SERVICES + "hdfs"; expectMkNodeFailure(operations, servicePath); }
Example 7
Source File: TestSecureRMRegistryOperations.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testAnonNoWriteAccessOffRoot() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); describe(LOG, "testAnonNoWriteAccessOffRoot"); RegistryOperations operations = RegistryOperationsFactory.createAnonymousInstance(zkClientConf); addToTeardown(operations); operations.start(); assertFalse("mknode(/)", operations.mknode("/", false)); expectMkNodeFailure(operations, "/sub"); expectDeleteFailure(operations, PATH_SYSTEM_SERVICES, true); }
Example 8
Source File: TestSecureRMRegistryOperations.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testAlicePathRestrictedAnonAccess() throws Throwable { 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); }
Example 9
Source File: TestSecureRMRegistryOperations.java From hadoop with Apache License 2.0 | 4 votes |
@Test public void testDigestAccess() throws Throwable { RMRegistryOperationsService registryAdmin = startRMRegistryOperations(); String id = "username"; String pass = "password"; registryAdmin.addWriteAccessor(id, pass); List<ACL> clientAcls = registryAdmin.getClientAcls(); LOG.info("Client ACLS=\n{}", RegistrySecurity.aclsToString(clientAcls)); String base = "/digested"; registryAdmin.mknode(base, false); List<ACL> baseACLs = registryAdmin.zkGetACLS(base); String aclset = RegistrySecurity.aclsToString(baseACLs); LOG.info("Base ACLs=\n{}", aclset); ACL found = null; for (ACL acl : baseACLs) { if (ZookeeperConfigOptions.SCHEME_DIGEST.equals(acl.getId().getScheme())) { found = acl; break; } } assertNotNull("Did not find digest entry in ACLs " + aclset, found); zkClientConf.set(KEY_REGISTRY_USER_ACCOUNTS, "sasl:[email protected], sasl:other"); RegistryOperations operations = RegistryOperationsFactory.createAuthenticatedInstance(zkClientConf, id, pass); addToTeardown(operations); operations.start(); RegistryOperationsClient operationsClient = (RegistryOperationsClient) operations; List<ACL> digestClientACLs = operationsClient.getClientAcls(); LOG.info("digest client ACLs=\n{}", RegistrySecurity.aclsToString(digestClientACLs)); operations.stat(base); operations.mknode(base + "/subdir", false); ZKPathDumper pathDumper = registryAdmin.dumpPath(true); LOG.info(pathDumper.toString()); }
Example 10
Source File: TestSecureRMRegistryOperations.java From big-c with Apache License 2.0 | 4 votes |
@Test public void testDigestAccess() throws Throwable { RMRegistryOperationsService registryAdmin = startRMRegistryOperations(); String id = "username"; String pass = "password"; registryAdmin.addWriteAccessor(id, pass); List<ACL> clientAcls = registryAdmin.getClientAcls(); LOG.info("Client ACLS=\n{}", RegistrySecurity.aclsToString(clientAcls)); String base = "/digested"; registryAdmin.mknode(base, false); List<ACL> baseACLs = registryAdmin.zkGetACLS(base); String aclset = RegistrySecurity.aclsToString(baseACLs); LOG.info("Base ACLs=\n{}", aclset); ACL found = null; for (ACL acl : baseACLs) { if (ZookeeperConfigOptions.SCHEME_DIGEST.equals(acl.getId().getScheme())) { found = acl; break; } } assertNotNull("Did not find digest entry in ACLs " + aclset, found); zkClientConf.set(KEY_REGISTRY_USER_ACCOUNTS, "sasl:[email protected], sasl:other"); RegistryOperations operations = RegistryOperationsFactory.createAuthenticatedInstance(zkClientConf, id, pass); addToTeardown(operations); operations.start(); RegistryOperationsClient operationsClient = (RegistryOperationsClient) operations; List<ACL> digestClientACLs = operationsClient.getClientAcls(); LOG.info("digest client ACLs=\n{}", RegistrySecurity.aclsToString(digestClientACLs)); operations.stat(base); operations.mknode(base + "/subdir", false); ZKPathDumper pathDumper = registryAdmin.dumpPath(true); LOG.info(pathDumper.toString()); }