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 188945a889a HDDS-17837. Speed up xcompat tests (#12119)
188945a889a is described below

commit 188945a889a7f6f8852aab9d4179f82b3b862c6d
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Nov 25 08:04:42 2026 +0100

    HDDS-17837. Speed up xcompat tests (#12119)
---
 .../hadoop/ozone/shell/ReplicationOptions.java     |   5 +
 .../ozone/shell/ShellReplicationOptions.java       |   2 +
 hadoop-ozone/dist/src/main/compose/testlib.sh      |   1 +
 .../src/main/smoketest/compatibility/read.robot    |  89 +++++++++--------
 .../src/main/smoketest/compatibility/setup.robot   |   7 ++
 .../src/main/smoketest/compatibility/write.robot   | 105 ++++++++++++---------
 hadoop-ozone/dist/src/main/smoketest/lib/os.robot  |   4 +
 .../dist/src/main/smoketest/ozone-lib/batch.robot  |  33 +++++--
 .../dist/src/main/smoketest/ozone-lib/shell.robot  |  16 ++++
 9 files changed, 170 insertions(+), 92 deletions(-)

diff --git 
a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ReplicationOptions.java
 
b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ReplicationOptions.java
index ad13b3b1ae1..4ab57236c8a 100644
--- 
a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ReplicationOptions.java
+++ 
b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ReplicationOptions.java
@@ -84,6 +84,11 @@ protected void setReplication(String replication) {
 
   // Option is defined in subclasses
   protected void setType(String type) {
+    if (type == null) {
+      this.type = null;
+      return;
+    }
+
     try {
       ReplicationType replicationType = ReplicationType.valueOf(type);
       if (replicationType == ReplicationType.CHAINED
diff --git 
a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ShellReplicationOptions.java
 
b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ShellReplicationOptions.java
index df188c4d9fb..ba7fc58d60e 100644
--- 
a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ShellReplicationOptions.java
+++ 
b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ShellReplicationOptions.java
@@ -25,6 +25,7 @@
 public class ShellReplicationOptions extends ReplicationOptions {
 
   @Option(names = {"-t", "--type", "--replication-type"},
+      defaultValue = Option.NULL_VALUE,
       description = TYPE_DESCRIPTION)
   @Override
   public void setType(String type) {
@@ -32,6 +33,7 @@ public void setType(String type) {
   }
 
   @Option(names = {"--replication", "-r"},
+      defaultValue = Option.NULL_VALUE,
       description = REPLICATION_DESCRIPTION)
   @Override
   public void setReplication(String replication) {
diff --git a/hadoop-ozone/dist/src/main/compose/testlib.sh 
b/hadoop-ozone/dist/src/main/compose/testlib.sh
index 69a000fff58..c5fedaaafa9 100755
--- a/hadoop-ozone/dist/src/main/compose/testlib.sh
+++ b/hadoop-ozone/dist/src/main/compose/testlib.sh
@@ -297,6 +297,7 @@ execute_robot_test(){
       -v ENCRYPTION_KEY:"${OZONE_BUCKET_KEY_NAME:-}" \
       -v OM_HA_PARAM:"${OM_HA_PARAM}" \
       -v OM_SERVICE_ID:"${OM_SERVICE_ID:-om}" \
+      -v OZONE_CURRENT_VERSION:"${OZONE_CURRENT_VERSION}" \
       -v OZONE_DIR:"${OZONE_DIR}" \
       -v SECURITY_ENABLED:"${SECURITY_ENABLED}" \
       -v SHORT_CIRCUIT_READ_ENABLED:"${SHORT_CIRCUIT_READ_ENABLED:-false}" \
diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot 
b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
index cf71f0178c1..c69c86380d7 100644
--- a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
@@ -18,6 +18,10 @@ Documentation       Read Compatibility
 Resource            ../ozone-lib/shell.robot
 Resource            ../snapshot/lib.resource
 Resource            setup.robot
+Resource            ../ozone-lib/batch.robot
+Resource            ../ozone-lib/batch-shell.robot
+Suite Setup         Setup Suite
+Suite Teardown      Teardown Suite
 Test Timeout        5 minutes
 
 
@@ -28,54 +32,59 @@ ${SNAPSHOT2}         snapshot-2-${DATA_VERSION}
 ${SNAPSHOT3}         snapshot-3-${DATA_VERSION}
 ${SNAPSHOT_KEY1}     snapdiff-key1-${DATA_VERSION}
 ${SNAPSHOT_KEY2}     snapdiff-key2-${DATA_VERSION}
-
-
-*** Keywords ***
-Key List With Replication
-    [arguments]    ${args}
-    ${list} =      Execute    ozone sh key list ${args}
-    ${result} =    Execute    echo '${list}' | jq -r '[.name, 
.replicationType, (.replicationFactor | tostring)] | join (" ")'
-    [return]    ${result}
+${KEY_REPLICATION_FILTER}    jq -r '[.name, .replicationType, 
(.replicationFactor | tostring)] | join (" ")'
 
 
 *** Test Cases ***
 Buckets Can Be Listed
-    ${result} =     Execute     ozone sh bucket list /vol1
-    Should Contain    ${result}    bucket1
+    ${result} =     Execute Later ozone sh    bucket list /vol1
+    Assert Later    File ${result} Should    Contain    bucket1
 
     IF    '${CLUSTER_VERSION}' >= '${EC_VERSION}'
-        Should Contain    ${result}    ratis-${CLUSTER_VERSION}
-        Should Contain    ${result}    ecbucket-${CLUSTER_VERSION}
+        Assert Later    File ${result} Should
+        ...    Contain    ratis-${CLUSTER_VERSION}
+        ...    Contain    ecbucket-${CLUSTER_VERSION}
     END
 
 Bucket Without Replication Config
-    Verify Bucket Empty Replication Config    /vol1/bucket1
+    ${result} =     Execute Later ozone sh    bucket info /vol1/bucket1
+    Assert Later    Verify Empty Replication Config in ${result}
 
 Bucket With Replication Config
     Pass Execution If    '${CLUSTER_VERSION}' < '${EC_VERSION}'   Cluster does 
not support EC
 
+    ${ratis_result} =    Execute Later ozone sh    bucket info 
/vol1/ratis-${CLUSTER_VERSION}
+    ${ec_result} =    Execute Later ozone sh    bucket info 
/vol1/ecbucket-${CLUSTER_VERSION}
+
     IF    '${CLIENT_VERSION}' >= '${EC_VERSION}'
-        Verify Bucket Replica Replication Config    
/vol1/ratis-${CLUSTER_VERSION}   RATIS   THREE
-        Verify Bucket EC Replication Config    
/vol1/ecbucket-${CLUSTER_VERSION}    RS    3    2    1048576
+        Assert Later    Verify Replica Replication Config in ${ratis_result}   
 RATIS   THREE
+        Assert Later    Verify EC Replication Config in ${ec_result}    RS    
3    2    1048576
     ELSE
-        Verify Bucket Empty Replication Config    
/vol1/ratis-${CLUSTER_VERSION}
-        Verify Bucket Empty Replication Config    
/vol1/ecbucket-${CLUSTER_VERSION}
+        Assert Later    Verify Empty Replication Config in ${ratis_result}
+        Assert Later    Verify Empty Replication Config in ${ec_result}
     END
 
 Key Can Be Read
-    Key Should Match Local File    /vol1/bucket1/key-${DATA_VERSION}    
${TESTFILE}
+    ${result} =    Get Key Later    /vol1/bucket1/key-${DATA_VERSION}
+    Assert Later    Compare Files    ${result}    ${TESTFILE}
 
 Encrypted Key Can Be Read
-    Key Should Match Local File    /vol1/encrypted-${DATA_VERSION}/key    
${TESTFILE}
+    ${result} =    Get Key Later    /vol1/encrypted-${DATA_VERSION}/key
+    Assert Later    Compare Files    ${result}    ${TESTFILE}
+
+Encrypted File Can Be Read
     File Should Match Local File    
ofs://om/vol1/encrypted-${DATA_VERSION}/key    ${TESTFILE}
 
 Key Read From Bucket With Replication
     Pass Execution If    '${CLUSTER_VERSION}' < '${EC_VERSION}'   Cluster does 
not support EC
 
-    Key Should Match Local File     
/vol1/ratis-${CLUSTER_VERSION}/key-${DATA_VERSION}      ${TESTFILE}
+    ${get_from_ratis_bucket} =    Get Key Later    
/vol1/ratis-${CLUSTER_VERSION}/key-${DATA_VERSION}
+    Assert Later    Compare Files    ${get_from_ratis_bucket}    ${TESTFILE}
 
     IF    '${CLIENT_VERSION}' >= '${EC_VERSION}' or '${DATA_VERSION}' == 
'${CLIENT_VERSION}'
-        Key Should Match Local File     
/vol1/ecbucket-${CLUSTER_VERSION}/key-${DATA_VERSION}      ${TESTFILE}
+        ${ec_local} =    Get Next Filename    ${BATCH_OUTPUT_DIR}/key-get
+        ${ec_result} =    Execute Later ozone sh    key get 
/vol1/ecbucket-${CLUSTER_VERSION}/key-${DATA_VERSION} ${ec_local}
+        Assert Later    Compare Files    ${ec_local}    ${TESTFILE}
     ELSE
         Assert Unsupported    ozone sh key get -f 
/vol1/ecbucket-${CLUSTER_VERSION}/key-${DATA_VERSION} /dev/null
     END
@@ -114,32 +123,33 @@ File Can Be Listed
     END
 
 Key List
+    ${result} =    Execute Later ozone sh    key list /vol1/bucket1
+
     IF    '${CLIENT_VERSION}' >= '${EC_VERSION}'
-        ${result} =     Execute    ozone sh key list /vol1/bucket1
-                        Should Contain    ${result}    key-${DATA_VERSION}
+        Assert Later    File ${result} Should    Contain    key-${DATA_VERSION}
     ELSE IF    '${DATA_VERSION}' < '${EC_VERSION}' # New client creates 
RATIS/ONE key by default: BUG?
-        ${result} =     Key List With Replication    /vol1/bucket1
-                        Should contain    ${result}    key-${DATA_VERSION} 
RATIS 3
+        Assert Later    File ${result} Filtered By ${KEY_REPLICATION_FILTER} 
Should    Contain    key-${DATA_VERSION} RATIS 3
     END
 
 Key List In Bucket With Replication
     Pass Execution If    '${CLUSTER_VERSION}' < '${EC_VERSION}'   Cluster does 
not support EC
 
-    IF    '${CLIENT_VERSION}' < '${EC_VERSION}'
-        ${result} =     Key List With Replication    
/vol1/ratis-${CLUSTER_VERSION}/
-                        Should contain  ${result}   key-${DATA_VERSION} RATIS 3
+    ${ratis_result} =     Execute Later ozone sh    key list 
/vol1/ratis-${CLUSTER_VERSION}
 
+    IF    '${CLIENT_VERSION}' < '${EC_VERSION}'
+        Assert Later    File ${ratis_result} Filtered By 
${KEY_REPLICATION_FILTER} Should    Contain    key-${DATA_VERSION} RATIS 3
         Assert Unsupported    ozone sh key list 
/vol1/ecbucket-${CLUSTER_VERSION}/
     ELSE
-        ${result} =     Execute    ozone sh key list 
/vol1/ratis-${CLUSTER_VERSION}
-                        Should Contain    ${result}    key-${DATA_VERSION}
-        ${result} =     Execute    ozone sh key list 
/vol1/ecbucket-${CLUSTER_VERSION}
-                        Should Contain    ${result}    key-${DATA_VERSION}
+        Assert Later    File ${ratis_result} Should    Contain    
key-${DATA_VERSION}
+        ${ec_result} =     Execute Later ozone sh    key list 
/vol1/ecbucket-${CLUSTER_VERSION}
+        Assert Later    File ${ec_result} Should    Contain    
key-${DATA_VERSION}
     END
 
-
 File Can Be Get
-    Key Should Match Local File    
/vol1/bucket1/dir-${DATA_VERSION}/file-${DATA_VERSION}    ${TESTFILE}
+    ${file} =    Get Key Later    
/vol1/bucket1/dir-${DATA_VERSION}/file-${DATA_VERSION}
+    Assert Later    Compare Files    ${file}    ${TESTFILE}
+
+File Can Be Get via FS
     File Should Match Local File    
o3fs://bucket1.vol1/dir-${DATA_VERSION}/file-${DATA_VERSION}    ${TESTFILE}
 
 File Can Be Get From Bucket With Replication
@@ -173,11 +183,11 @@ Key Info File Flag Should Be Set Correctly
     ${dirpath} =      Set Variable    /${FSO_BUCKET}/dir/subdir/
     ${filepath} =     Set Variable    ${dirpath}file
 
-    ${key_info} =     Execute    ozone sh key info ${filepath}
-    Should Contain    ${key_info}    \"file\" : true
+    ${key_info} =     Execute Later ozone sh    key info ${filepath}
+    Assert Later    File ${key_info} Should    Contain    \"file\" : true
 
-    ${dir_info} =     Execute    ozone sh key info ${dirpath}
-    Should Contain    ${dir_info}    \"file\" : false
+    ${dir_info} =     Execute Later ozone sh    key info ${dirpath}
+    Assert Later    File ${dir_info} Should    Contain    \"file\" : false
 
 Snapshots Can Be Diffed
     Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'    
Cluster does not support snapshots
@@ -213,3 +223,6 @@ Can --get-report of --ordered Snapshot Diff
     IF    '${CLUSTER_VERSION}' >= '${SNAPSHOT_DIFF_ORDERED_VERSION}' and 
'${CLIENT_VERSION}' >= '${SNAPSHOT_DIFF_ORDERED_VERSION}'
         Should Contain    ${output}    Report is dependency ordered
     END
+
+Execute Batch Shell
+    Execute Batch
diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/setup.robot 
b/hadoop-ozone/dist/src/main/smoketest/compatibility/setup.robot
index c38b256f839..8424643cfea 100644
--- a/hadoop-ozone/dist/src/main/smoketest/compatibility/setup.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/setup.robot
@@ -26,3 +26,10 @@ ${SNAPSHOT_DIFF_SUBMIT_VERSION}   2.2.0
 ${SNAPSHOT_DIFF_ORDERED_VERSION}   2.3.0
 ${HSYNC_VERSION}      2.0.0
 ${TESTFILE}           ${TEST_DATA_DIR}/small
+
+*** Keywords ***
+Setup Suite
+    Setup Batch
+
+Teardown Suite
+    Teardown Batch
diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/write.robot 
b/hadoop-ozone/dist/src/main/smoketest/compatibility/write.robot
index 4d3b1fad1cc..e9b25a4ccb0 100644
--- a/hadoop-ozone/dist/src/main/smoketest/compatibility/write.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/write.robot
@@ -19,6 +19,10 @@ Resource            ../ozone-lib/shell.robot
 Resource            setup.robot
 Resource            ../lib/fs.robot
 Resource            ../ozone-lib/freon.robot
+Resource            ../ozone-lib/batch.robot
+Resource            ../ozone-lib/batch-shell.robot
+Suite Setup         Setup Suite
+Suite Teardown      Teardown Suite
 Test Timeout        5 minutes
 
 *** Variables ***
@@ -40,31 +44,74 @@ Expected Snapshot Diff Output
     END
 
 
-
 *** Test Cases ***
 Create Bucket With Replication Type
     Pass Execution If    '${CLIENT_VERSION}' < '${EC_VERSION}'    Client does 
not support EC
     Pass Execution If    '${CLUSTER_VERSION}' < '${EC_VERSION}'   Cluster does 
not support EC
-    Execute             ozone sh bucket create --replication 3 --type RATIS 
/vol1/ratis-${CLIENT_VERSION}
-    Execute             ozone sh bucket create --replication rs-3-2-1024k 
--type EC /vol1/ecbucket-${CLIENT_VERSION}
+    Execute Later and Expect No Output For ozone sh    bucket create 
--replication 3 --type RATIS /vol1/ratis-${CLIENT_VERSION}
+    Execute Later and Expect No Output For ozone sh    bucket create 
--replication rs-3-2-1024k --type EC /vol1/ecbucket-${CLIENT_VERSION}
 
 Create Encrypted Bucket
-    Execute    ozone sh bucket create -k ${ENCRYPTION_KEY} 
/vol1/encrypted-${CLIENT_VERSION}
+    Execute Later and Expect No Output For ozone sh    bucket create -k 
${ENCRYPTION_KEY} /vol1/encrypted-${CLIENT_VERSION}
 
 Create Key in Encrypted Bucket
-    Execute    ozone sh key put /vol1/encrypted-${CLIENT_VERSION}/key 
${TESTFILE}
+    Execute Later and Expect No Output For ozone sh    key put 
/vol1/encrypted-${CLIENT_VERSION}/key ${TESTFILE}
 
 Key Can Be Written
-    Create Key    /vol1/bucket1/key-${CLIENT_VERSION}    ${TESTFILE}
+    Execute Later and Expect No Output For ozone sh    key put 
/vol1/bucket1/key-${CLIENT_VERSION} ${TESTFILE}
 
 Key Can Be Written To Bucket With Replication Type
     Pass Execution If    '${CLUSTER_VERSION}' < '${EC_VERSION}'   Cluster does 
not support EC
-    Execute         ozone sh key put 
/vol1/ratis-${CLUSTER_VERSION}/key-${CLIENT_VERSION} ${TESTFILE}
-    Execute         ozone sh key put 
/vol1/ecbucket-${CLUSTER_VERSION}/key-${CLIENT_VERSION} ${TESTFILE}
+    Execute Later and Expect No Output For ozone sh    key put 
/vol1/ratis-${CLUSTER_VERSION}/key-${CLIENT_VERSION} ${TESTFILE}
+    Execute Later and Expect No Output For ozone sh    key put 
/vol1/ecbucket-${CLUSTER_VERSION}/key-${CLIENT_VERSION} ${TESTFILE}
 
 Key Can Be Deleted
-    Create Key    /vol1/bucket1/to-be-deleted-${CLIENT_VERSION}    ${TESTFILE}
-    Execute       ozone sh key delete 
/vol1/bucket1/to-be-deleted-${CLIENT_VERSION}
+    Execute Later and Expect No Output For ozone sh    key put 
/vol1/bucket1/to-be-deleted-${CLIENT_VERSION} ${TESTFILE}
+    Execute Later and Expect No Output For ozone sh    key delete 
/vol1/bucket1/to-be-deleted-${CLIENT_VERSION}
+
+FSO Bucket Can Be Created
+    Pass Execution If    '${CLIENT_VERSION}' < '${FSO_VERSION}'    Client does 
not support FSO
+    Pass Execution If    '${CLUSTER_VERSION}' < '${FSO_VERSION}'   Cluster 
does not support FSO
+    Execute Later and Expect No Output For ozone sh    bucket create --layout 
FILE_SYSTEM_OPTIMIZED ${FSO_BUCKET}
+
+Snapshot Can Be Created
+    Pass Execution If    '${CLIENT_VERSION}' < '${SNAPSHOT_VERSION}'    Client 
does not support snapshots
+    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
+
+    Execute Later ozone sh    snapshot create ${FSO_BUCKET} ${SNAPSHOT1}
+    Execute Later and Expect No Output For ozone sh    key put 
${FSO_BUCKET}/${SNAPSHOT_KEY1} ${TESTFILE}
+    Execute Later ozone sh    snapshot create ${FSO_BUCKET} ${SNAPSHOT2}
+    Execute Later and Expect No Output For ozone sh    key put 
${FSO_BUCKET}/${SNAPSHOT_KEY2} ${TESTFILE}
+    Execute Later ozone sh    snapshot create ${FSO_BUCKET} ${SNAPSHOT3}
+
+Snapshot Diff Can Be Requested
+    Pass Execution If    '${CLIENT_VERSION}' < '${SNAPSHOT_VERSION}'    Client 
does not support snapshots
+    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
+
+    ${output} =    Execute Later ozone sh    snapshot diff ${FSO_BUCKET} 
${SNAPSHOT1} ${SNAPSHOT2}
+    ${expected} =    Expected Snapshot Diff Output
+    Assert Later    File ${output} Should    Contain    ${expected}
+
+Snapshot Diff --get-report Submits Job On Old Cluster
+    Pass Execution If    '${CLIENT_VERSION}' < 
'${SNAPSHOT_DIFF_SUBMIT_VERSION}'    Client does not support snapshot diff 
submit
+    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
+    Pass Execution If    '${CLUSTER_VERSION}' >= 
'${SNAPSHOT_DIFF_SUBMIT_VERSION}'    Cluster supports snapshot diff submit, no 
fallback
+
+    ${output} =    Execute Later ozone sh    snapshot diff --get-report 
${FSO_BUCKET} ${SNAPSHOT2} ${SNAPSHOT3}
+    ${expected} =    Expected Snapshot Diff Output
+    Assert Later    File ${output} Should    Contain    ${expected}
+
+Snapshot Diff Can Be --ordered
+    Pass Execution If    '${CLIENT_VERSION}' < 
'${SNAPSHOT_DIFF_ORDERED_VERSION}'    Client does not support ordered snapshots
+    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'          
      Cluster does not support snapshots
+
+    ${output} =    Execute Later ozone sh    snapshot diff --ordered 
${FSO_BUCKET} ${SNAPSHOT1} ${SNAPSHOT3}
+    ${expected} =    Expected Snapshot Diff Output
+    Assert Later    File ${output} Should    Contain    ${expected}
+
+# execute batch before any ozone fs or other non-sh commands
+Execute Batch Shell
+    Execute Batch
 
 Dir Can Be Created
     Execute    ozone fs -mkdir o3fs://bucket1.vol1/dir-${CLIENT_VERSION}
@@ -81,10 +128,9 @@ File Can Be Deleted
     Execute    ozone fs -put ${TESTFILE} 
o3fs://bucket1.vol1/dir-${CLIENT_VERSION}/to-be-deleted
     Execute    ozone fs -rm -skipTrash 
o3fs://bucket1.vol1/dir-${CLIENT_VERSION}/to-be-deleted
 
-FSO Bucket Can Be Created and Used
+FSO Bucket Can Be Written To
     Pass Execution If    '${CLIENT_VERSION}' < '${FSO_VERSION}'    Client does 
not support FSO
     Pass Execution If    '${CLUSTER_VERSION}' < '${FSO_VERSION}'   Cluster 
does not support FSO
-    Execute    ozone sh bucket create --layout FILE_SYSTEM_OPTIMIZED 
${FSO_BUCKET}
     Execute    ozone fs -mkdir -p ofs://om/${FSO_BUCKET}/dir/subdir
     Execute    ozone fs -put ${TESTFILE} ofs://om/${FSO_BUCKET}/dir/subdir/file
 
@@ -95,38 +141,3 @@ HSync Can Be Used To Create Keys
     Freon DFSG      sync=HSYNC    n=1    path=${o3fspath}
     ${pfspath} =    Format FS URL         ofs      $vol1    bucket1
     Freon DFSG      sync=HSYNC    n=1    path=${pfspath}
-
-Snapshot Can Be Created
-    Pass Execution If    '${CLIENT_VERSION}' < '${SNAPSHOT_VERSION}'    Client 
does not support snapshots
-    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
-
-    Execute          ozone sh snapshot create ${FSO_BUCKET} ${SNAPSHOT1}
-    Execute          ozone sh key put ${FSO_BUCKET}/${SNAPSHOT_KEY1} 
${TESTFILE}
-    Execute          ozone sh snapshot create ${FSO_BUCKET} ${SNAPSHOT2}
-    Execute          ozone sh key put ${FSO_BUCKET}/${SNAPSHOT_KEY2} 
${TESTFILE}
-    Execute          ozone sh snapshot create ${FSO_BUCKET} ${SNAPSHOT3}
-
-Snapshot Diff Can Be Requested
-    Pass Execution If    '${CLIENT_VERSION}' < '${SNAPSHOT_VERSION}'    Client 
does not support snapshots
-    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
-
-    ${output} =    Execute    ozone sh snapshot diff ${FSO_BUCKET} 
${SNAPSHOT1} ${SNAPSHOT2}
-    ${expected} =    Expected Snapshot Diff Output
-    Should Contain    ${output}    ${expected}
-
-Snapshot Diff --get-report Submits Job On Old Cluster
-    Pass Execution If    '${CLIENT_VERSION}' < 
'${SNAPSHOT_DIFF_SUBMIT_VERSION}'    Client does not support snapshot diff 
submit
-    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'   
Cluster does not support snapshots
-    Pass Execution If    '${CLUSTER_VERSION}' >= 
'${SNAPSHOT_DIFF_SUBMIT_VERSION}'    Cluster supports snapshot diff submit, no 
fallback
-
-    ${output} =    Execute    ozone sh snapshot diff --get-report 
${FSO_BUCKET} ${SNAPSHOT2} ${SNAPSHOT3}
-    ${expected} =    Expected Snapshot Diff Output
-    Should Contain    ${output}    ${expected}
-
-Snapshot Diff Can Be --ordered
-    Pass Execution If    '${CLIENT_VERSION}' < 
'${SNAPSHOT_DIFF_ORDERED_VERSION}'    Client does not support ordered snapshots
-    Pass Execution If    '${CLUSTER_VERSION}' < '${SNAPSHOT_VERSION}'          
      Cluster does not support snapshots
-
-    ${output} =    Execute    ozone sh snapshot diff --ordered ${FSO_BUCKET} 
${SNAPSHOT1} ${SNAPSHOT3}
-    ${expected} =    Expected Snapshot Diff Output
-    Should Contain    ${output}    ${expected}
diff --git a/hadoop-ozone/dist/src/main/smoketest/lib/os.robot 
b/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
index df5f5907f27..364b48889db 100644
--- a/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
@@ -84,3 +84,7 @@ File ${file} Should
     FOR    ${keyword}    ${arg}    IN    @{args}
         Run Keyword    Should ${keyword}    ${content}    ${arg}
     END
+
+Log Contents of ${file}
+    ${content} =    Get File    ${file}
+    Log    ${content}
diff --git a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot 
b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot
index ba25303a977..23881be80e4 100644
--- a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot
@@ -21,6 +21,11 @@ Resource            ../lib/os.robot
 Resource            ../ozone-lib/shell.robot
 
 
+*** Variables ***
+${BATCH_VERSION}     2.3.0
+${CLIENT_VERSION}    ${OZONE_CURRENT_VERSION}
+
+
 *** Keywords ***
 Setup Batch
     Init Batch
@@ -31,8 +36,11 @@ Setup Batch
 
 
 Teardown Batch
-    Execute Batch
-    Remove Directory    ${BATCH_OUTPUT_DIR}    recursive=True
+    TRY
+        Execute Batch
+    FINALLY
+        Remove Directory    ${BATCH_OUTPUT_DIR}    recursive=True
+    END
 
 
 Init Batch
@@ -69,11 +77,22 @@ Execute Later ozone ${subcmd}
     ${output_file} =    Get Next Filename    
${BATCH_OUTPUT_DIR}/out-ozone-${subcmd}
     ${cmd_with_redirection} =    Set Variable    ${command} > ${output_file}
 
-    ${debug_comment} =    Set Variable    \# ${test_name}
-    Append To List    ${BATCH_COMMANDS}    ${debug_comment}
-    Append To List    ${BATCH_COMMANDS}    ${cmd_with_redirection}
-    Set Suite Variable    ${BATCH_QUEUEING}    ${TRUE}
-    Set Suite Variable    ${BATCH_SUBCMD}    ${subcmd}
+    IF    '${CLIENT_VERSION}' < '${BATCH_VERSION}'
+        ${error_file} =    Get Next Filename    
${BATCH_OUTPUT_DIR}/err-ozone-${subcmd}
+        ${rc} =    Run and Return RC    ozone ${subcmd} 
${cmd_with_redirection} 2> ${error_file}
+        Log    rc = ${rc}
+        Log Contents of ${output_file}
+        Log Contents of ${error_file}
+        IF    '${rc}' != '0'
+            ${output_file} =    Set Variable    ${error_file}
+        END
+    ELSE
+        ${debug_comment} =    Set Variable    \# ${test_name}
+        Append To List    ${BATCH_COMMANDS}    ${debug_comment}
+        Append To List    ${BATCH_COMMANDS}    ${cmd_with_redirection}
+        Set Suite Variable    ${BATCH_QUEUEING}    ${TRUE}
+        Set Suite Variable    ${BATCH_SUBCMD}    ${subcmd}
+    END
     Log    Output of test ${test_name} command ${command} redirected to 
${output_file}
 
     RETURN    ${output_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 77843cdac80..aca6e62f771 100644
--- a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/shell.robot
@@ -26,6 +26,8 @@ Ozone Shell Batch
 
 Ozone Batch ${subcmd}
     [arguments]    @{commands}
+    ${len} =    Get Length    ${commands}
+    Return From Keyword If    ${len} == 0
     ${cmd} =    Catenate    SEPARATOR=' --execute '    @{commands}
     Run    ozone ${subcmd} --continue-batch-on-error --execute '${cmd}' &> 
${TEMP_DIR}/batch.out
     ${output} =    Get File    ${TEMP_DIR}/batch.out
@@ -124,3 +126,17 @@ Verify EC Replication Config
                    Should Match Regexp      ${result}       ^(?m)${data}$
                    Should Match Regexp      ${result}       ^(?m)${parity}$
                    Should Match Regexp      ${result}       ^(?m)${chunksize}$
+
+Verify Empty Replication Config in ${file}
+    ${result} =    Execute    jq -r '.replicationConfig' ${file}
+    Should Be Equal    ${result}    null
+
+Verify Replica Replication Config in ${file}
+    [arguments]    @{params}
+    ${result} =    Execute    jq -r '.replicationConfig.replicationType, 
.replicationConfig.replicationFactor' ${file}
+                   Verify Replica Replication Config    ${result}   @{params}
+
+Verify EC Replication Config in ${file}
+    [arguments]    @{params}
+    ${result} =    Execute    jq -r '.replicationConfig.replicationType, 
.replicationConfig.codec, .replicationConfig.data, .replicationConfig.parity, 
.replicationConfig.ecChunkSize' ${file}
+                   Verify EC Replication Config     ${result}    @{params}


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

Reply via email to