chihsuan commented on code in PR #10209:
URL: https://github.com/apache/ozone/pull/10209#discussion_r3585986384


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -403,6 +404,49 @@ public void testCreateKeyWithECReplicationConfig() throws 
Exception {
     createKeyWithECReplicationConfig(root, cluster.getConf());
   }
 
+  @Test
+  void testContentSummaryErasureCodingPolicy() throws Exception {
+    String ratisKey = "ratis-ec-policy-key";
+    String ecKey = "ec-policy-key";
+    ECReplicationConfig ecConfig = new ECReplicationConfig("RS-3-2-1024k");
+    Path parentDir = new Path(OZONE_URI_DELIMITER, "ec-policy-mixed-o3fs");
+    Path ratisFile = new Path(parentDir, ratisKey);
+    Path ecFile = new Path(parentDir, ecKey);
+
+    fs.mkdirs(parentDir);
+    String ratisRelKey = "ec-policy-mixed-o3fs/" + ratisKey;
+    String ecRelKey = "ec-policy-mixed-o3fs/" + ecKey;
+    TestDataUtil.createKey(ozoneBucket, ratisRelKey,
+        RatisReplicationConfig.getInstance(HddsProtos.ReplicationFactor.THREE),
+        new byte[]{0});
+    TestDataUtil.createKey(ozoneBucket, ecRelKey, ecConfig,
+        new byte[]{0});
+
+    try {
+      assertEquals("",
+          fs.getContentSummary(ROOT).getErasureCodingPolicy());
+      assertEquals("Replicated",
+          fs.getContentSummary(ratisFile).getErasureCodingPolicy());
+      assertEquals(ecConfig.getReplication(),
+          fs.getContentSummary(ecFile).getErasureCodingPolicy());
+      assertEquals("",
+          fs.getContentSummary(parentDir).getErasureCodingPolicy());
+    } finally {
+      fs.delete(parentDir, true);
+    }
+  }
+
+  @Test
+  void testLsDashEDoesNotThrow() throws Exception {

Review Comment:
   Thanks for checking this. The two tests intentionally cover separate layers:
   
   The CLI test covers the original exception, while 
`testContentSummaryErasureCodingPolicy` verifies the exact policy values. I’d 
prefer to keep them separate.



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