DadanielZ commented on a change in pull request #743: HADOOP-11452 make 
rename/3 public
URL: https://github.com/apache/hadoop/pull/743#discussion_r280004735
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java
 ##########
 @@ -623,26 +625,25 @@ public void 
testGlobStatusFilterWithMultiplePathWildcardsAndNonTrivialFilter()
     FileStatus[] filteredPaths = fSys.globStatus(
         getTestRootPath(fSys, "test/hadoop/a??"),
         TEST_X_FILTER);
-    Assert.assertEquals(2, filteredPaths.length);
-    Assert.assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXA),
+    assertEquals(2, filteredPaths.length);
+    assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXA),
         filteredPaths));
-    Assert.assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXX),
+    assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXX),
         filteredPaths));
   }
 
   @Test
   public void testGlobStatusThrowsExceptionForUnreadableDir()
       throws Exception {
+    assumePermissionsSupported();
     Path testRootDir = getTestRootPath(fSys, "test/hadoop/dir");
     Path obscuredDir = new Path(testRootDir, "foo");
     Path subDir = new Path(obscuredDir, "bar"); //so foo is non-empty
     fSys.mkdirs(subDir);
     fSys.setPermission(obscuredDir, new FsPermission((short)0)); //no access
     try {
-      fSys.globStatus(getTestRootPath(fSys, "test/hadoop/dir/foo/*"));
-      Assert.fail("Should throw IOException");
-    } catch (IOException ioe) {
-      // expected
+      intercept(IOException.class, () ->
 
 Review comment:
   This test does permission check for `getFileStatus` call.
   But according to 
[HdfsPermissionsGuide](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html),
 `getFileStatus/getFileInfo` call should not check the permission. I'm 
wondering do I miss any documents?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to