@Test(expected = YarnException.class)
public void testNoMemoryCGgroupMount() throws Exception {

  File procfs = new File(basePath + "/1234");
  Assert.assertTrue("Setup error", procfs.mkdirs());
  try {
    FileUtils.writeStringToFile(
        new File(procfs, CGroupsResourceCalculator.CGROUP),
        "7:devices:/yarn/container_1\n" +
            "6:cpuacct,cpu:/yarn/container_1\n" +
            "5:pids:/yarn/container_1\n", StandardCharsets.UTF_8);
    CGroupsResourceCalculator calculator =
        new CGroupsResourceCalculator(
            "1234", basePath,
            cGroupsHandler, clock, 10);
    calculator.setCGroupFilePaths();
    Assert.assertEquals("Expected exception", null, calculator);
  } finally {
    FileUtils.deleteDirectory(new File(basePath));
  }
}