adoroszlai commented on a change in pull request #3030:
URL: https://github.com/apache/ozone/pull/3030#discussion_r800058691



##########
File path: hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot
##########
@@ -61,3 +61,21 @@ Create Key
     ${output} =    Execute          ozone sh key put ${key} ${file}
                    Should not contain  ${output}       Failed
     Log            Uploaded ${file} to ${key}
+
+Verify Bucket EC Replication Config
+    [arguments]    ${volume}    ${encoding}    ${data}    ${parity}    
${chunksize}
+    ${result} =    Execute                      ozone sh bucket list ${volume} 
| jq -r '.[] | select(.name | contains("${prefix}ec")) | 
.replicationConfig.replicationType, .replicationConfig.codec, 
.replicationConfig.data, .replicationConfig.parity, 
.replicationConfig.ecChunkSize'

Review comment:
       I think directly passing bucket is more reusable, instead of relying on 
suite variable and naming convention.
   
   ```suggestion
       [arguments]    ${bucket}    ${encoding}    ${data}    ${parity}    
${chunksize}
       ${result} =    Execute                      ozone sh bucket info 
${bucket} | jq -r '.replicationConfig.replicationType, 
.replicationConfig.codec, .replicationConfig.data, .replicationConfig.parity, 
.replicationConfig.ecChunkSize'
   ```

##########
File path: hadoop-ozone/dist/src/main/smoketest/ec/basic.robot
##########
@@ -0,0 +1,71 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation       Test EC shell commands
+Library             OperatingSystem
+Resource            ../commonlib.robot
+Resource            ../ozone-lib/shell.robot
+Suite Setup         Prepare For Tests
+
+*** Variables ***
+${SCM}       scm
+
+*** Keywords ***
+
+Prepare For Tests
+    ${random} =         Generate Random String  5  [NUMBERS]
+    Set Suite Variable  ${prefix}  ${random}
+    Execute             dd if=/dev/urandom of=/tmp/1mb bs=1048576 count=1
+    Execute             dd if=/dev/urandom of=/tmp/2mb bs=1048576 count=2
+    Execute             dd if=/dev/urandom of=/tmp/3mb bs=1048576 count=3
+    Execute             dd if=/dev/urandom of=/tmp/100mb bs=1048576 count=100
+
+*** Test Cases ***
+
+Test Bucket Creation
+    ${result} =     Execute             ozone sh volume create /${prefix}vol1
+                    Should not contain  ${result}       Failed
+    ${result} =     Execute             ozone sh bucket create 
/${prefix}vol1/${prefix}ratis
+                    Should not contain  ${result}       Failed
+    ${result} =     Execute             ozone sh bucket list /${prefix}vol1 | 
jq -r '.[] | select(.name | contains("${prefix}ratis")) | 
.replicationConfig.replicationType'
+                    Should contain      ${result}       RATIS
+    ${result} =     Execute             ozone sh bucket create --replication 
rs-3-2-1024k --type EC /${prefix}vol1/${prefix}ec
+                    Should not contain  ${result}       Failed
+                    Verify Bucket EC Replication Config    /${prefix}vol1    
RS    3    2    1048576

Review comment:
       ```suggestion
                       Verify Bucket EC Replication Config    
/${prefix}vol1/${prefix}ec    RS    3    2    1048576
   ```




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