umamaheswararao commented on a change in pull request #2010:
URL: https://github.com/apache/hadoop/pull/2010#discussion_r426191817



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemLinkFallback.java
##########
@@ -261,4 +261,53 @@ public void testConfLinkFallbackWithMountPoint() throws 
Exception {
           e.getMessage().contains(expectedErrorMsg));
     }
   }
+
+  @Test
+  public void testListingWithFallbackLink() throws Exception {
+    fsTarget.mkdirs(new Path(targetTestRoot, "fallbackDir/dir1"));
+    fsTarget.mkdirs(new Path(targetTestRoot, "fallbackDir/dir2"));
+    String clusterName = Constants.CONFIG_VIEWFS_DEFAULT_MOUNT_TABLE;
+    URI viewFsUri = new URI(FsConstants.VIEWFS_SCHEME, clusterName,
+        "/", null, null);
+
+    int itemCount = 0;
+    try(FileSystem vfs = FileSystem.get(viewFsUri, conf)) {
+      itemCount = vfs.listStatus(new Path(viewFsUri.toString())).length;
+    }
+
+    ConfigUtil.addLinkFallback(conf, clusterName,
+        new Path(targetTestRoot, "fallbackDir").toUri());
+
+    try (FileSystem vfs = FileSystem.get(viewFsUri, conf)) {
+      FileStatus[] statuses = vfs.listStatus(new Path(viewFsUri.toString()));
+      assertTrue("Listing didn't include fallback link",

Review comment:
        Thanks you for addressing. Let me take a look at it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to