@Test
public void testExecutorPath() {

  String containerExePath = PrivilegedOperationExecutor
      .getContainerExecutorExecutablePath(nullConf);
  //In case HADOOP_YARN_HOME isn't set, CWD is used. If conf is null or
  //NM_LINUX_CONTAINER_EXECUTOR_PATH is not set, then a defaultPath is
  //constructed.
  String yarnHomeEnvVar = System.getenv("HADOOP_YARN_HOME");
  String yarnHome = yarnHomeEnvVar != null ? yarnHomeEnvVar
      : new File("").getAbsolutePath();
  String expectedPath = yarnHome + "/bin/container-executor";
  Assert.assertEquals(expectedPath, containerExePath);
  containerExePath = PrivilegedOperationExecutor
      .getContainerExecutorExecutablePath(emptyConf);
  Assert.assertEquals(expectedPath, containerExePath);
  //if NM_LINUX_CONTAINER_EXECUTOR_PATH is set, this must be returned
  expectedPath = customExecutorPath;
  containerExePath = PrivilegedOperationExecutor
      .getContainerExecutorExecutablePath(confWithExecutorPath);
  Assert.assertEquals(expectedPath, containerExePath);
}