steveloughran commented on a change in pull request #743:
URL: https://github.com/apache/hadoop/pull/743#discussion_r479676808



##########
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:
       I'm going to revert all changes to this test suite other than those 
which go near rename, so whatever is tested for today is going to be exactly 
what is continued to be tested for. I Don't know what the nuances of HDFS 
permissions are. 
   I'd assume that the getFileStatus call only needs metadata/list permissions, 
rather than read access. That HDFS doc states that client needs execute 
permission on all parent directories, so that it can get from / to the file. 
Therefore the "has permissions to call getFileXXX" is implicit if you can get 
to the dir, right?




----------------------------------------------------------------
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]



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

Reply via email to