From d5cd12c0826d4ae79e5782e73b5e41dd4ec74692 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Tue, 12 Jun 2018 10:24:34 -0700 Subject: [PATCH] HADOOP-15529. ContainerLaunch#testInvalidEnvVariableSubstitutionType is not supported in Windows. Contributed by Giovanni Matteo Fumarola. (cherry picked from commit 6e756e8a620e4d6dc3192986679060c52063489b) --- .../launcher/TestContainerLaunch.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java index fb17c8c8909..5d77b608a57 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java @@ -1832,7 +1832,11 @@ public class TestContainerLaunch extends BaseContainerManagerTest { public void testInvalidEnvVariableSubstitutionType1() throws IOException { Map env = new HashMap(); // invalid env - env.put("testVar", "version${foo.version}"); + String invalidEnv = "version${foo.version}"; + if (Shell.WINDOWS) { + invalidEnv = "version%foo%<>^&|=:version%"; + } + env.put("testVar", invalidEnv); validateShellExecutorForDifferentEnvs(env); } @@ -1843,7 +1847,11 @@ public class TestContainerLaunch extends BaseContainerManagerTest { public void testInvalidEnvVariableSubstitutionType2() throws IOException { Map env = new HashMap(); // invalid env - env.put("testPath", "/abc:/${foo.path}:/$bar"); + String invalidEnv = "/abc:/${foo.path}:/$bar"; + if (Shell.WINDOWS) { + invalidEnv = "/abc:/%foo%<>^&|=:path%:/%bar%"; + } + env.put("testPath", invalidEnv); validateShellExecutorForDifferentEnvs(env); }