diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java index 740a8ab274..dacbb859b3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java @@ -69,6 +69,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystemTestHelper; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.fs.permission.FsAction; +import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.DistributedFileSystem; @@ -158,6 +160,15 @@ public static void createOriginalFSImage() throws IOException { hdfs.mkdirs(invalidXMLDir); dirCount++; + //Create a directory with sticky bits + Path stickyBitDir = new Path("/stickyBit"); + hdfs.mkdirs(stickyBitDir); + hdfs.setPermission(stickyBitDir, new FsPermission(FsAction.ALL, + FsAction.ALL, FsAction.ALL, true)); + dirCount++; + writtenFiles.put(stickyBitDir.toString(), + hdfs.getFileStatus(stickyBitDir)); + // Get delegation tokens so we log the delegation token op Token[] delegationTokens = hdfs .addDelegationTokens(TEST_RENEWER, null);