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

adoroszlai pushed a commit to branch HDDS-3816-ec
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-3816-ec by this push:
     new 9a0f812  HDDS-6231. EC: Create EC acceptance test environment and some 
basic tests (#3030)
9a0f812 is described below

commit 9a0f812b3bbd439583955eef16441fc4aa9d94f6
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Mon Feb 7 12:29:39 2022 +0000

    HDDS-6231. EC: Create EC acceptance test environment and some basic tests 
(#3030)
---
 hadoop-ozone/dist/src/main/compose/ozone/test.sh   |  4 +-
 .../dist/src/main/smoketest/ec/basic.robot         | 71 ++++++++++++++++++++++
 .../dist/src/main/smoketest/ozone-lib/shell.robot  | 18 ++++++
 3 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/hadoop-ozone/dist/src/main/compose/ozone/test.sh 
b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
index 5aacbfc..070cebf 100755
--- a/hadoop-ozone/dist/src/main/compose/ozone/test.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
@@ -26,7 +26,7 @@ export OZONE_REPLICATION_FACTOR=3
 # shellcheck source=/dev/null
 source "$COMPOSE_DIR/../testlib.sh"
 
-start_docker_env
+start_docker_env 5
 
 execute_robot_test scm lib
 execute_robot_test scm ozone-lib
@@ -59,6 +59,8 @@ execute_robot_test scm -v BUCKET:${bucket} -N 
s3-${bucket}-fso-layout-objectcopy
 execute_robot_test scm -v BUCKET:${bucket} -N 
s3-${bucket}-fso-layout-objectmultidelete s3/objectmultidelete.robot
 execute_robot_test scm -v BUCKET:${bucket} -N 
s3-${bucket}-fso-layout-MultipartUpload s3/MultipartUpload.robot
 
+execute_robot_test scm ec
+
 stop_docker_env
 
 generate_report
diff --git a/hadoop-ozone/dist/src/main/smoketest/ec/basic.robot 
b/hadoop-ozone/dist/src/main/smoketest/ec/basic.robot
new file mode 100644
index 0000000..fdd3a1b
--- /dev/null
+++ b/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/${prefix}ec    RS    3    2    1048576
+
+Test key Creation
+                    Execute                             ozone sh key put 
/${prefix}vol1/${prefix}ec/${prefix}1mb /tmp/1mb
+                    Execute                             ozone sh key put 
/${prefix}vol1/${prefix}ec/${prefix}2mb /tmp/2mb
+                    Execute                             ozone sh key put 
/${prefix}vol1/${prefix}ec/${prefix}3mb /tmp/3mb
+                    Execute                             ozone sh key put 
/${prefix}vol1/${prefix}ec/${prefix}100mb /tmp/100mb
+
+                    Key Should Match Local File         
/${prefix}vol1/${prefix}ec/${prefix}1mb      /tmp/1mb
+                    Key Should Match Local File         
/${prefix}vol1/${prefix}ec/${prefix}2mb      /tmp/2mb
+                    Key Should Match Local File         
/${prefix}vol1/${prefix}ec/${prefix}3mb      /tmp/3mb
+                    Key Should Match Local File         
/${prefix}vol1/${prefix}ec/${prefix}100mb    /tmp/100mb
+
+                    Verify Key EC Replication Config    
/${prefix}vol1/${prefix}ec/${prefix}1mb    RS    3    2    1048576
+
+Test Ratis Key EC Bucket
+                    Execute                       ozone sh key put 
--replication=THREE --type=RATIS /${prefix}vol1/${prefix}ec/${prefix}1mbRatis 
/tmp/1mb
+                    Key Should Match Local File   
/${prefix}vol1/${prefix}ec/${prefix}1mbRatis    /tmp/1mb
+    ${result}       Execute                       ozone sh key info 
/${prefix}vol1/${prefix}ec/${prefix}1mbRatis | jq -r 
'.replicationConfig.replicationType'
+                    Should Match Regexp           ${result}       ^(?m)RATIS$
+
+Test EC Key Ratis Bucket
+                    Execute                             ozone sh key put 
--replication=rs-3-2-1024k --type=EC 
/${prefix}vol1/${prefix}ratis/${prefix}1mbEC /tmp/1mb
+                    Key Should Match Local File         
/${prefix}vol1/${prefix}ratis/${prefix}1mbEC    /tmp/1mb
+                    Verify Key EC Replication Config    
/${prefix}vol1/${prefix}ratis/${prefix}1mbEC    RS    3    2    1048576
\ No newline at end of file
diff --git a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot 
b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot
index 23d305e..c31f9bc 100644
--- a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot
+++ b/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]    ${bucket}    ${encoding}    ${data}    ${parity}    
${chunksize}
+    ${result} =    Execute                      ozone sh bucket info ${bucket} 
| jq -r '.replicationConfig.replicationType, .replicationConfig.codec, 
.replicationConfig.data, .replicationConfig.parity, 
.replicationConfig.ecChunkSize'
+                   Verify Replication Config    ${result}    ${encoding}    
${data}    ${parity}    ${chunksize}
+
+Verify Key EC Replication Config
+    [arguments]    ${key}    ${encoding}    ${data}    ${parity}    
${chunksize}
+    ${result} =    Execute                      ozone sh key info ${key} | jq 
-r '.replicationConfig.replicationType, .replicationConfig.codec, 
.replicationConfig.data, .replicationConfig.parity, 
.replicationConfig.ecChunkSize'
+                   Verify Replication Config    ${result}    ${encoding}    
${data}    ${parity}    ${chunksize}
+
+Verify Replication Config
+    [arguments]    ${result}    ${encoding}    ${data}    ${parity}    
${chunksize}
+                   Should Match Regexp      ${result}       ^(?m)EC$
+                   Should Match Regexp      ${result}       ^(?m)${encoding}$
+                   Should Match Regexp      ${result}       ^(?m)${data}$
+                   Should Match Regexp      ${result}       ^(?m)${parity}$
+                   Should Match Regexp      ${result}       ^(?m)${chunksize}$
\ No newline at end of file

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

Reply via email to