diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index c1e7bd92e34..0f274bd1652 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -258,10 +258,13 @@ Release 0.23.1 - UNRELEASED HDFS-2335. DataNodeCluster and NNStorage always pull fresh entropy. (Uma Maheswara Rao G via eli) - HDFS-2574. Remove references to some deprecated properties in conf templates and defaults files. (Joe Crobak via harsh) + HDFS-2574. Remove references to some deprecated properties in conf + templates and defaults files. (Joe Crobak via harsh) HDFS-2722. HttpFs should not be using an int for block size. (harsh) + HDFS-2710. Add HDFS tests related to HADOOP-7933. (sid via suresh) + OPTIMIZATIONS HDFS-2130. Switch default checksum to CRC32C. (todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java index 66b8fa32a3e..83115edaad4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java @@ -20,44 +20,54 @@ package org.apache.hadoop.fs.viewfs; import java.io.IOException; import java.net.URISyntaxException; -import java.util.List; import javax.security.auth.login.LoginException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileSystemTestHelper; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.server.namenode.NameNodeAdapter; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.security.token.Token; - import org.junit.After; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Test; public class TestViewFileSystemHdfs extends ViewFileSystemBaseTest { private static MiniDFSCluster cluster; private static Path defaultWorkingDirectory; + private static Path defaultWorkingDirectory2; private static Configuration CONF = new Configuration(); private static FileSystem fHdfs; + private static FileSystem fHdfs2; + private FileSystem fsTarget2; + Path targetTestRoot2; @BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { SupportsBlocks = true; - cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(2).build(); + cluster = + new MiniDFSCluster.Builder(CONF).numNameNodes(2).numDataNodes(2) + .build(); cluster.waitClusterUp(); - NameNodeAdapter.getDtSecretManager(cluster.getNamesystem()).startThreads(); - fHdfs = cluster.getFileSystem(); + NameNodeAdapter.getDtSecretManager(cluster.getNamesystem(0)).startThreads(); + NameNodeAdapter.getDtSecretManager(cluster.getNamesystem(1)).startThreads(); + + fHdfs = cluster.getFileSystem(0); + fHdfs2 = cluster.getFileSystem(1); + defaultWorkingDirectory = fHdfs.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); + defaultWorkingDirectory2 = fHdfs2.makeQualified( new Path("/user/" + + UserGroupInformation.getCurrentUser().getShortUserName())); + fHdfs.mkdirs(defaultWorkingDirectory); + fHdfs2.mkdirs(defaultWorkingDirectory2); } @@ -70,25 +80,42 @@ public class TestViewFileSystemHdfs extends ViewFileSystemBaseTest { public void setUp() throws Exception { // create the test root on local_fs fsTarget = fHdfs; + fsTarget2 = fHdfs2; + targetTestRoot2 = FileSystemTestHelper.getAbsoluteTestRootPath(fsTarget2); super.setUp(); - } @After public void tearDown() throws Exception { super.tearDown(); } - - /* - * This overides the default implementation since hdfs does have delegation - * tokens. - */ + @Override - @Test - public void testGetDelegationTokens() throws IOException { - List> delTokens = - fsView.getDelegationTokens("sanjay"); - Assert.assertEquals(7, delTokens.size()); + void setupMountPoints() { + super.setupMountPoints(); + ConfigUtil.addLink(conf, "/mountOnNn2", new Path(targetTestRoot2, + "mountOnNn2").toUri()); } + // Overriden test helper methods - changed values based on hdfs and the + // additional mount. + @Override + int getExpectedDirPaths() { + return 7; + } + + @Override + int getExpectedMountPoints() { + return 8; + } + + @Override + int getExpectedDelegationTokenCount() { + return 8; + } + + @Override + int getExpectedDelegationTokenCountWithCredentials() { + return 2; + } }