|
@@ -57,10 +57,8 @@ import org.apache.hadoop.yarn.api.records.Token;
|
|
|
import org.apache.hadoop.yarn.api.records.URL;
|
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.ExitCode;
|
|
|
-import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.Signal;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.BaseContainerManagerTest;
|
|
|
-import org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch;
|
|
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer;
|
|
|
import org.apache.hadoop.yarn.server.utils.BuilderUtils;
|
|
|
import org.apache.hadoop.yarn.util.ConverterUtils;
|
|
@@ -159,7 +157,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
|
|
|
public void testContainerEnvVariables() throws Exception {
|
|
|
containerManager.start();
|
|
|
|
|
|
- ContainerLaunchContext containerLaunchContext =
|
|
|
+ ContainerLaunchContext containerLaunchContext =
|
|
|
recordFactory.newRecordInstance(ContainerLaunchContext.class);
|
|
|
|
|
|
// ////// Construct the Container-id
|
|
@@ -177,7 +175,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
|
|
|
userSetEnv.put(Environment.LOCAL_DIRS.name(), "user_set_LOCAL_DIR");
|
|
|
containerLaunchContext.setEnvironment(userSetEnv);
|
|
|
|
|
|
- File scriptFile = new File(tmpDir, "scriptFile.sh");
|
|
|
+ File scriptFile = Shell.appendScriptExtension(tmpDir, "scriptFile");
|
|
|
PrintWriter fileWriter = new PrintWriter(scriptFile);
|
|
|
File processStartFile =
|
|
|
new File(tmpDir, "env_vars.txt").getAbsoluteFile();
|
|
@@ -192,6 +190,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
|
|
|
+ processStartFile);
|
|
|
fileWriter.println("@echo " + Environment.LOCAL_DIRS.$() + ">> "
|
|
|
+ processStartFile);
|
|
|
+ fileWriter.println("@echo " + cId + ">> " + processStartFile);
|
|
|
fileWriter.println("@ping -n 100 127.0.0.1 >nul");
|
|
|
} else {
|
|
|
fileWriter.write("\numask 0"); // So that start file is readable by the test
|