This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 2fa8d6c432 HDDS-10159. Add test for putting key with 
ECReplicationConfig by shell. (#6030)
2fa8d6c432 is described below

commit 2fa8d6c4321cf2885221ec012e731fac5742cb20
Author: WangYuanben <[email protected]>
AuthorDate: Fri Jan 19 22:41:52 2024 +0800

    HDDS-10159. Add test for putting key with ECReplicationConfig by shell. 
(#6030)
---
 .../hadoop/ozone/shell/TestOzoneShellHA.java       | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
index 92381829f0..dd84489b68 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
@@ -1249,6 +1249,29 @@ public class TestOzoneShellHA {
         key.getReplicationConfig().getReplicationType());
   }
 
+  @Test
+  public void testPutKeyWithECReplicationConfig() throws Exception {
+    final String volumeName = UUID.randomUUID().toString();
+    final String bucketName = UUID.randomUUID().toString();
+    final String keyName = UUID.randomUUID().toString();
+    getVolume(volumeName);
+    String bucketPath =
+            Path.SEPARATOR + volumeName + Path.SEPARATOR + bucketName;
+    String[] args =
+            new String[] {"bucket", "create", bucketPath};
+    execute(ozoneShell, args);
+
+    args = new String[] {"key", "put", "-r", "rs-3-2-1024k", "-t", "EC",
+        bucketPath + Path.SEPARATOR + keyName, testFilePathString};
+    execute(ozoneShell, args);
+
+    OzoneKeyDetails key =
+            client.getObjectStore().getVolume(volumeName)
+                    .getBucket(bucketName).getKey(keyName);
+    assertEquals(HddsProtos.ReplicationType.EC,
+            key.getReplicationConfig().getReplicationType());
+  }
+
   @Test
   public void testCreateBucketWithRatisReplicationConfig() throws Exception {
     final String volumeName = "volume101";


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

Reply via email to