smengcl commented on code in PR #11501:
URL: https://github.com/apache/ozone/pull/11501#discussion_r4309978890


##########
hadoop-ozone/integration-test/src/test/resources/auditlog.properties:
##########
@@ -60,7 +60,7 @@ appender.console.layout.pattern = %d{DEFAULT} | %-5level | 
%c{1} | %msg | %throw
 
 appender.audit.type = File
 appender.audit.name = AUDITLOG
-appender.audit.fileName=audit.log
+appender.audit.fileName=target/audit.log

Review Comment:
   Moving this appender to `target/audit.log` breaks `TestOzoneTenantShell`, 
which still reads `new File("audit.log")`. On a clean run, 
`testOzoneTenantBasicOperations` now fails at its first audit log read (line 
357) with `NoSuchFileException: audit.log`, before it runs any tenant command.
   
   Either:
   1. Keep the move and update every test that reads the audit log file 
directly. `TestOzoneTenantShell` needs the change below, and 
`TestOzoneRpcClientForAclAuditLog` (currently `@Unhealthy`) has three more `new 
File("audit.log")` references.
   2. Drop the audit log change from this PR, and do it in a separate JIRA 
along with these test updates.
   
   ```diff
   --- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java
   +++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java
   @@ -86,7 +86,7 @@
    
      @TempDir
      private static Path path;
   -  private static final File AUDIT_LOG_FILE = new File("audit.log");
   +  private static final File AUDIT_LOG_FILE = new File("target/audit.log");
    
      private static OzoneConfiguration conf = null;
      private static MiniOzoneHAClusterImpl cluster = null;
   ```
   



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java:
##########
@@ -434,6 +441,62 @@ public void testS3Auth() throws Exception {
     assertEquals(Status.INVALID_TOKEN, omResponse.getStatus());
   }
 
+  /**
+   * Reads a multi-cell EC key with S3 authentication and a read-consistency 
hint set on the request thread, with
+   * sequential and with parallel EC reads.
+   */
+  @ParameterizedTest
+  @ValueSource(booleans = {false, true})
+  void testEcReadWithS3AuthAndReadConsistency(boolean parallelRead) throws 
Exception {
+    String volumeName = UUID.randomUUID().toString();
+    String bucketName = UUID.randomUUID().toString();
+    String keyName = UUID.randomUUID().toString();
+    getStore().createVolume(volumeName);
+    getStore().getVolume(volumeName).createBucket(bucketName);
+    OzoneBucket bucket = 
getStore().getVolume(volumeName).getBucket(bucketName);
+
+    // Two full rs-3-2-1024k stripes and a partial one, so one read spans all 
data cells.
+    byte[] data = new byte[7 * (int) OzoneConsts.MB + 100];
+    ThreadLocalRandom.current().nextBytes(data);
+    ECReplicationConfig ecConfig = new ECReplicationConfig(3, 2, 
ECReplicationConfig.EcCodec.RS, (int) OzoneConsts.MB);
+    try (OzoneOutputStream out = bucket.createKey(keyName, data.length, 
ecConfig, new HashMap<>())) {
+      out.write(data);
+    }
+
+    String strToSign = "AWS4-HMAC-SHA256\n" +

Review Comment:
   Minor: `strToSign`, `signature` and `secret` repeat the values in 
`testS3Auth` above. Could they become shared constants, or a small helper that 
stores the secret and returns the `S3Auth`?
   



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