@Test
public void testBootstrapLimits() throws Exception {

  Configuration conf = new YarnConfiguration();
  int cpuPerc = 80;
  conf.setInt(YarnConfiguration.NM_RESOURCE_PERCENTAGE_PHYSICAL_CPU_LIMIT,
      cpuPerc);
  int period = (CGroupsCpuResourceHandlerImpl.MAX_QUOTA_US * 100) / (cpuPerc
      * numProcessors);
  List<PrivilegedOperation> ret =
      cGroupsCpuResourceHandler.bootstrap(plugin, conf);
  verify(mockCGroupsHandler, times(1))
      .initializeCGroupController(CGroupsHandler.CGroupController.CPU);
  verify(mockCGroupsHandler, times(1))
      .updateCGroupParam(CGroupsHandler.CGroupController.CPU, "",
          CGroupsHandler.CGROUP_CPU_PERIOD_US, String.valueOf(period));
  verify(mockCGroupsHandler, times(1))
      .updateCGroupParam(CGroupsHandler.CGroupController.CPU, "",
          CGroupsHandler.CGROUP_CPU_QUOTA_US,
          String.valueOf(CGroupsCpuResourceHandlerImpl.MAX_QUOTA_US));
  Assert.assertNull(ret);
}