Package org.apache.hadoop.yarn.server.timeline.security

Examples of org.apache.hadoop.yarn.server.timeline.security.TimelineACLsManager


  @Test
  public void testYarnACLsNotEnabled() throws Exception {
    Configuration conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, false);
    TimelineACLsManager timelineACLsManager =
        new TimelineACLsManager(conf);
    TimelineEntity entity = new TimelineEntity();
    entity.addPrimaryFilter(
        TimelineStore.SystemFilter.ENTITY_OWNER
            .toString(), "owner");
    Assert.assertTrue(
        "Always true when ACLs are not enabled",
        timelineACLsManager.checkAccess(
            UserGroupInformation.createRemoteUser("user"), entity));
  }
View Full Code Here


  @Test
  public void testYarnACLsEnabled() throws Exception {
    Configuration conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
    conf.set(YarnConfiguration.YARN_ADMIN_ACL, "admin");
    TimelineACLsManager timelineACLsManager =
        new TimelineACLsManager(conf);
    TimelineEntity entity = new TimelineEntity();
    entity.addPrimaryFilter(
        TimelineStore.SystemFilter.ENTITY_OWNER
            .toString(), "owner");
    Assert.assertTrue(
        "Owner should be allowed to access",
        timelineACLsManager.checkAccess(
            UserGroupInformation.createRemoteUser("owner"), entity));
    Assert.assertFalse(
        "Other shouldn't be allowed to access",
        timelineACLsManager.checkAccess(
            UserGroupInformation.createRemoteUser("other"), entity));
    Assert.assertTrue(
        "Admin should be allowed to access",
        timelineACLsManager.checkAccess(
            UserGroupInformation.createRemoteUser("admin"), entity));
  }
View Full Code Here

  @Test
  public void testCorruptedOwnerInfo() throws Exception {
    Configuration conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
    conf.set(YarnConfiguration.YARN_ADMIN_ACL, "owner");
    TimelineACLsManager timelineACLsManager =
        new TimelineACLsManager(conf);
    TimelineEntity entity = new TimelineEntity();
    try {
      timelineACLsManager.checkAccess(
          UserGroupInformation.createRemoteUser("owner"), entity);
      Assert.fail("Exception is expected");
    } catch (YarnException e) {
      Assert.assertTrue("It's not the exact expected exception", e.getMessage()
          .contains("is corrupted."));
View Full Code Here

      createTimelineDelegationTokenSecretManagerService(Configuration conf) {
    return new TimelineDelegationTokenSecretManagerService();
  }

  protected TimelineACLsManager createTimelineACLsManager(Configuration conf) {
    return new TimelineACLsManager(conf);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.timeline.security.TimelineACLsManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.