rich7420 commented on code in PR #12193:
URL: https://github.com/apache/ozone/pull/12193#discussion_r4774882658


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/OzoneFileSystemTestBase.java:
##########
@@ -432,6 +434,34 @@ void setVerifyChecksum(MiniOzoneCluster cluster, Path 
path) throws Exception {
     }
   }
 
+  /**
+   * Files are reported with {@code ozone.fs.file.permission.reported}, by 
both getFileStatus and listStatus, and
+   * directories with 777. Deletes the test directory.
+   */
+  void reportedFilePermission(Path root) throws IOException {
+    Path dir = new Path(root, "testReportedFilePermission");
+    Path file = new Path(dir, "file");
+    FileSystem fs = getFs();
+    fs.mkdirs(dir);
+    ContractTestUtils.touch(fs, file);
+    try {
+      assertEquals(FsPermission.getFileDefault(), 
fs.getFileStatus(file).getPermission());
+
+      OzoneConfiguration conf = new OzoneConfiguration(fs.getConf());
+      conf.set(OZONE_FS_FILE_PERMISSION_REPORTED, "600");
+      FsPermission ownerOnly = new FsPermission((short) 0600);
+      try (FileSystem ownerOnlyFs = FileSystem.newInstance(fs.getUri(), conf)) 
{
+        assertEquals(ownerOnly, 
ownerOnlyFs.getFileStatus(file).getPermission());
+        FileStatus[] listing = ownerOnlyFs.listStatus(dir);

Review Comment:
   Worth adding a subdir to this listing? I made the lite converter use 
`filePermission` for dirs too and `TestO3FS` still passed.



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

To unsubscribe, e-mail: [email protected]

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