HADOOP-11282. Skip NFS TestShellBasedIdMapping tests that are irrelevant on Windows. Contributed by Chris Nauroth.

This commit is contained in:
cnauroth 2014-11-07 14:30:29 -08:00
parent 4cfd5bc7c1
commit 68db5b3736
2 changed files with 8 additions and 0 deletions

View File

@ -1086,6 +1086,9 @@ Release 2.6.0 - UNRELEASED
HADOOP-11280. TestWinUtils#testChmod fails after removal of HADOOP-11280. TestWinUtils#testChmod fails after removal of
NO_PROPAGATE_INHERIT_ACE. (cnauroth) NO_PROPAGATE_INHERIT_ACE. (cnauroth)
HADOOP-11282. Skip NFS TestShellBasedIdMapping tests that are irrelevant on
Windows. (cnauroth)
Release 2.5.2 - UNRELEASED Release 2.5.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -19,6 +19,7 @@
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -27,6 +28,7 @@
import java.util.Map; import java.util.Map;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.Shell;
import org.apache.hadoop.security.ShellBasedIdMapping.PassThroughMap; import org.apache.hadoop.security.ShellBasedIdMapping.PassThroughMap;
import org.apache.hadoop.security.ShellBasedIdMapping.StaticMapping; import org.apache.hadoop.security.ShellBasedIdMapping.StaticMapping;
import org.junit.Test; import org.junit.Test;
@ -73,6 +75,7 @@ public void testStaticMapParsing() throws IOException {
@Test @Test
public void testStaticMapping() throws IOException { public void testStaticMapping() throws IOException {
assumeTrue(!Shell.WINDOWS);
Map<Integer, Integer> uidStaticMap = new PassThroughMap<Integer>(); Map<Integer, Integer> uidStaticMap = new PassThroughMap<Integer>();
Map<Integer, Integer> gidStaticMap = new PassThroughMap<Integer>(); Map<Integer, Integer> gidStaticMap = new PassThroughMap<Integer>();
@ -113,6 +116,7 @@ public void testStaticMapping() throws IOException {
@Test @Test
public void testDuplicates() throws IOException { public void testDuplicates() throws IOException {
assumeTrue(!Shell.WINDOWS);
String GET_ALL_USERS_CMD = "echo \"root:x:0:0:root:/root:/bin/bash\n" String GET_ALL_USERS_CMD = "echo \"root:x:0:0:root:/root:/bin/bash\n"
+ "hdfs:x:11501:10787:Grid Distributed File System:/home/hdfs:/bin/bash\n" + "hdfs:x:11501:10787:Grid Distributed File System:/home/hdfs:/bin/bash\n"
+ "hdfs:x:11502:10788:Grid Distributed File System:/home/hdfs:/bin/bash\n" + "hdfs:x:11502:10788:Grid Distributed File System:/home/hdfs:/bin/bash\n"
@ -152,6 +156,7 @@ public void testDuplicates() throws IOException {
@Test @Test
public void testIdOutOfIntegerRange() throws IOException { public void testIdOutOfIntegerRange() throws IOException {
assumeTrue(!Shell.WINDOWS);
String GET_ALL_USERS_CMD = "echo \"" String GET_ALL_USERS_CMD = "echo \""
+ "nfsnobody:x:4294967294:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin\n" + "nfsnobody:x:4294967294:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin\n"
+ "nfsnobody1:x:4294967295:4294967295:Anonymous NFS User:/var/lib/nfs1:/sbin/nologin\n" + "nfsnobody1:x:4294967295:4294967295:Anonymous NFS User:/var/lib/nfs1:/sbin/nologin\n"