YARN-488. TestContainerManagerSecurity fails on Windows. Contributed by Chris Nauroth.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1459514 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a10fbb93e7
commit
92fb7cdcde
@ -18,6 +18,9 @@ Trunk - Unreleased
|
|||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
||||||
|
YARN-488. TestContainerManagerSecurity fails on Windows. (Chris Nauroth
|
||||||
|
via hitesh)
|
||||||
|
|
||||||
BREAKDOWN OF HADOOP-8562 SUBTASKS
|
BREAKDOWN OF HADOOP-8562 SUBTASKS
|
||||||
|
|
||||||
YARN-158. Yarn creating package-info.java must not depend on sh.
|
YARN-158. Yarn creating package-info.java must not depend on sh.
|
||||||
|
@ -570,9 +570,11 @@ public class ContainerLaunch implements Callable<Integer> {
|
|||||||
// additional testing. See YARN-358.
|
// additional testing. See YARN-358.
|
||||||
if (Shell.WINDOWS) {
|
if (Shell.WINDOWS) {
|
||||||
String inputClassPath = environment.get(Environment.CLASSPATH.name());
|
String inputClassPath = environment.get(Environment.CLASSPATH.name());
|
||||||
|
if (inputClassPath != null && !inputClassPath.isEmpty()) {
|
||||||
environment.put(Environment.CLASSPATH.name(),
|
environment.put(Environment.CLASSPATH.name(),
|
||||||
FileUtil.createJarWithClassPath(inputClassPath, pwd));
|
FileUtil.createJarWithClassPath(inputClassPath, pwd));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifiable environment variables
|
* Modifiable environment variables
|
||||||
|
@ -51,6 +51,7 @@ import org.apache.hadoop.security.AccessControlException;
|
|||||||
import org.apache.hadoop.security.SecurityUtil;
|
import org.apache.hadoop.security.SecurityUtil;
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
import org.apache.hadoop.security.token.Token;
|
import org.apache.hadoop.security.token.Token;
|
||||||
|
import org.apache.hadoop.util.Shell;
|
||||||
import org.apache.hadoop.yarn.api.AMRMProtocol;
|
import org.apache.hadoop.yarn.api.AMRMProtocol;
|
||||||
import org.apache.hadoop.yarn.api.ContainerManager;
|
import org.apache.hadoop.yarn.api.ContainerManager;
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
|
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
|
||||||
@ -401,10 +402,15 @@ public class TestContainerManagerSecurity {
|
|||||||
UnsupportedFileSystemException, YarnRemoteException,
|
UnsupportedFileSystemException, YarnRemoteException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
|
|
||||||
|
// Use ping to simulate sleep on Windows.
|
||||||
|
List<String> cmd = Shell.WINDOWS ?
|
||||||
|
Arrays.asList("ping", "-n", "100", "127.0.0.1", ">nul") :
|
||||||
|
Arrays.asList("sleep", "100");
|
||||||
|
|
||||||
ContainerLaunchContext amContainer = BuilderUtils
|
ContainerLaunchContext amContainer = BuilderUtils
|
||||||
.newContainerLaunchContext(null, "testUser", BuilderUtils
|
.newContainerLaunchContext(null, "testUser", BuilderUtils
|
||||||
.newResource(1024, 1), Collections.<String, LocalResource>emptyMap(),
|
.newResource(1024, 1), Collections.<String, LocalResource>emptyMap(),
|
||||||
new HashMap<String, String>(), Arrays.asList("sleep", "100"),
|
new HashMap<String, String>(), cmd,
|
||||||
new HashMap<String, ByteBuffer>(), null,
|
new HashMap<String, ByteBuffer>(), null,
|
||||||
new HashMap<ApplicationAccessType, String>());
|
new HashMap<ApplicationAccessType, String>());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user