@Test
public void testAuxServicesManifestPermissions() throws IOException {

  Assume.assumeTrue(useManifest);
  Configuration conf = getABConf();
  FileSystem fs = FileSystem.get(conf);
  fs.setPermission(new Path(manifest.getAbsolutePath()), FsPermission
      .createImmutable((short) 0777));
  AuxServices aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(0, aux.getServices().size());
  fs.setPermission(new Path(manifest.getAbsolutePath()), FsPermission
      .createImmutable((short) 0775));
  aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(0, aux.getServices().size());
  fs.setPermission(new Path(manifest.getAbsolutePath()), FsPermission
      .createImmutable((short) 0755));
  fs.setPermission(new Path(rootDir.getAbsolutePath()), FsPermission
      .createImmutable((short) 0775));
  aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(0, aux.getServices().size());
  fs.setPermission(new Path(rootDir.getAbsolutePath()), FsPermission
      .createImmutable((short) 0755));
  aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(2, aux.getServices().size());
  conf.set(YarnConfiguration.YARN_ADMIN_ACL, "");
  aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(0, aux.getServices().size());
  conf.set(YarnConfiguration.YARN_ADMIN_ACL, UserGroupInformation
      .getCurrentUser().getShortUserName());
  aux = new AuxServices(MOCK_AUX_PATH_HANDLER,
      MOCK_CONTEXT, MOCK_DEL_SERVICE);
  aux.init(conf);
  assertEquals(2, aux.getServices().size());
}