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 81aa78600ef HDDS-17807. Speed up basic/ozone-shell.robot (#12055)
81aa78600ef is described below

commit 81aa78600ef3b9567f99eec13d4df50acbe6fd11
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Fri Nov 20 11:37:12 2026 +0100

    HDDS-17807. Speed up basic/ozone-shell.robot (#12055)
---
 .../dist/src/main/smoketest/basic/links.robot      |  16 +-
 .../src/main/smoketest/basic/ozone-shell-lib.robot | 523 ++++++++++++---------
 .../main/smoketest/basic/ozone-shell-single.robot  |  15 +-
 .../src/main/smoketest/basic/ozone-shell.robot     |  30 +-
 hadoop-ozone/dist/src/main/smoketest/lib/os.robot  |   9 +
 .../batch-shell.robot}                             |  29 +-
 .../dist/src/main/smoketest/ozone-lib/batch.robot  |   6 +
 7 files changed, 386 insertions(+), 242 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/links.robot 
b/hadoop-ozone/dist/src/main/smoketest/basic/links.robot
index 558cbd48763..4fd4a2009bf 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/links.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/links.robot
@@ -19,6 +19,7 @@ Library             OperatingSystem
 Resource            ../commonlib.robot
 Resource            ../ozone-lib/shell.robot
 Resource            ../ozone-lib/batch.robot
+Resource            ../ozone-lib/batch-shell.robot
 Test Timeout        4 minute
 Suite Setup         Setup Suite
 Suite Teardown      Teardown Suite
@@ -103,13 +104,6 @@ Delete link loop
     Execute Later ozone sh    bucket delete ${target}/loop2
     Execute Later ozone sh    bucket delete ${target}/loop3
 
-Put and get key
-    [arguments]    ${put_to}    ${get_from}    ${put_from}=/etc/passwd
-    ${get_to} =    Get Next Filename    ${TEMP_DIR}/key-get
-    Execute Later ozone sh    key put ${put_to} ${put_from}
-    Execute Later ozone sh    key get -f ${get_from} ${get_to}
-    Assert Later    Compare Files    ${put_from}    ${get_to}
-
 
 *** Test Cases ***
 Link to non-existent bucket
@@ -132,11 +126,11 @@ Link chain to broken source
 
 Key create passthrough
     # put to link, get from bucket
-    Put and get key    put_to=${target}/link-to-existing-bucket/key1    
get_from=${source}/bucket-in-source/key1
+    Put and Get Key Later    put_to=${target}/link-to-existing-bucket/key1    
get_from=${source}/bucket-in-source/key1
 
 Key read passthrough
     # put to bucket, get from link
-    Put and get key    put_to=${source}/bucket-in-source/key2    
get_from=${target}/link-to-existing-bucket/key2
+    Put and Get Key Later    put_to=${source}/bucket-in-source/key2    
get_from=${target}/link-to-existing-bucket/key2
 
 Key list passthrough
     ${target_list} =    Execute Later ozone sh    key list 
${target}/link-to-existing-bucket
@@ -241,8 +235,8 @@ Loop in link chain is detected
 
 Multiple links to same bucket are allowed
     Execute Later ozone sh    bucket link ${source}/bucket-in-source 
${target}/another-link
-    Put and get key    put_to=${target}/another-link/key3    
get_from=${target}/link-to-existing-bucket/key3    put_from=/etc/group
-    Put and get key    put_to=${target}/link-to-existing-bucket/key4    
get_from=${target}/another-link/key4    put_from=/etc/hostname
+    Put and Get Key Later    put_to=${target}/another-link/key3    
get_from=${target}/link-to-existing-bucket/key3    put_from=/etc/group
+    Put and Get Key Later    put_to=${target}/link-to-existing-bucket/key4    
get_from=${target}/another-link/key4    put_from=/etc/hostname
 
 Source bucket not affected by deleting link
     Execute Later ozone sh    bucket link ${source}/bucket-in-source 
${target}/link-to-be-deleted
diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot 
b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
index 737a76c66a3..ecfe6fb67a9 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
@@ -17,13 +17,14 @@
 Documentation       Test ozone shell CLI usage
 Library             OperatingSystem
 Resource            ../commonlib.robot
+Resource            ../lib/os.robot
 Resource            ../ozone-lib/shell.robot
-Suite Setup         Get Security Enabled From Config
+Resource            ../ozone-lib/batch.robot
+Resource            ../ozone-lib/batch-shell.robot
 
 *** Variables ***
 ${prefix}    generated
 ${SCM}       scm
-${TMP_JSON}  ${TEMP_DIR}/bb1.json
 
 *** Keywords ***
 
@@ -34,69 +35,91 @@ Generate prefix
 Test ozone shell
     [arguments]     ${protocol}         ${server}       ${volume}
 
-    Kinit test user
+    Execute Later and Expect No Output For ozone sh    volume create 
${protocol}${server}/${volume} --space-quota 100TB --namespace-quota 100
+
+    ${result} =     Execute Later ozone sh    volume list ${protocol}${server}/
+    ${filter} =     Set Variable    jq -r '.[] | select(.name=="${volume}")'
+    Assert Later    File ${result} Filtered By ${filter} Should    Contain    
creationTime
 
-    ${result} =     Execute and checkrc    ozone sh volume info 
${protocol}${server}/${volume}      255
-                    Should contain      ${result}       VOLUME_NOT_FOUND
-    ${result} =     Execute             ozone sh volume create 
${protocol}${server}/${volume} --space-quota 100TB --namespace-quota 100
-                    Should Be Empty     ${result}
-    ${result} =     Execute             ozone sh volume list 
${protocol}${server}/ | jq -r '.[] | select(.name=="${volume}")'
-                    Should contain      ${result}       creationTime
 # TODO: Disable updating the owner, acls should be used to give access to 
other user.
-                    Execute             ozone sh volume setquota 
${protocol}${server}/${volume} --space-quota 10TB --namespace-quota 100
-#    ${result} =     Execute             ozone sh volume info 
${protocol}${server}/${volume} | jq -r '. | select(.volumeName=="${volume}") | 
.owner | .name'
-#                    Should Be Equal     ${result}       bill
-    ${result} =     Execute             ozone sh volume info 
${protocol}${server}/${volume} | jq -r '. | select(.name=="${volume}") | 
.quotaInBytes'
-                    Should Be Equal     ${result}       10995116277760
-    ${result} =     Execute             ozone sh bucket create 
${protocol}${server}/${volume}/bb1 --space-quota 10TB --namespace-quota 100
-                    Should Be Empty     ${result}
-                    Execute             ozone sh bucket info 
${protocol}${server}/${volume}/bb1 > ${TMP_JSON}
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.storageType' ${TMP_JSON}
-                    Should Be Equal     ${result}       DISK
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInBytes' ${TMP_JSON}
-                    Should Be Equal     ${result}       10995116277760
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInNamespace' ${TMP_JSON}
-                    Should Be Equal     ${result}       100
-                    Execute             ozone sh bucket setquota 
${protocol}${server}/${volume}/bb1 --space-quota 1TB --namespace-quota 1000
-                    Execute             ozone sh bucket info 
${protocol}${server}/${volume}/bb1 > ${TMP_JSON}
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInBytes' ${TMP_JSON}
-                    Should Be Equal     ${result}       1099511627776
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInNamespace' ${TMP_JSON}
-                    Should Be Equal     ${result}       1000
-    ${result} =     Execute             ozone sh bucket list 
${protocol}${server}/${volume}/ | jq -r '.[] | select(.name=="bb1") | 
.volumeName'
-                    Should Be Equal     ${result}       ${volume}
-                    Run Keyword         Test key handling       ${protocol}    
   ${server}       ${volume}
-                    Execute             ozone sh volume clrquota --space-quota 
${protocol}${server}/${volume}
-    ${result} =     Execute             ozone sh volume info 
${protocol}${server}/${volume} | jq -r '. | select(.name=="${volume}") | 
.quotaInBytes'
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh volume clrquota 
--namespace-quota ${protocol}${server}/${volume}
-    ${result} =     Execute             ozone sh volume info 
${protocol}${server}/${volume} | jq -r '. | select(.name=="${volume}") | 
.quotaInNamespace'
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh bucket clrquota --space-quota 
${protocol}${server}/${volume}/bb1
-    ${result} =     Execute             ozone sh bucket info 
${protocol}${server}/${volume}/bb1 | jq -r '. | select(.name=="bb1") | 
.quotaInBytes'
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh bucket clrquota 
--namespace-quota ${protocol}${server}/${volume}/bb1
-    ${result} =     Execute             ozone sh bucket info 
${protocol}${server}/${volume}/bb1 | jq -r '. | select(.name=="bb1") | 
.quotaInNamespace'
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh bucket delete -r --yes 
${protocol}${server}/${volume}/bb1
-                    Execute             ozone sh volume delete 
${protocol}${server}/${volume}
-                    Execute             ozone sh volume create 
${protocol}${server}/${volume}
-                    Execute             ozone sh volume info 
${protocol}${server}/${volume} > ${TMP_JSON}
-    ${result} =     Execute             jq -r '. | select(.name=="${volume}") 
| .quotaInBytes' ${TMP_JSON}
-                    Should Be Equal     ${result}       -1
-    ${result} =     Execute             jq -r '. | select(.name=="${volume}") 
| .quotaInNamespace' ${TMP_JSON}
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh bucket create 
${protocol}${server}/${volume}/bb1
-                    Execute             ozone sh bucket info 
${protocol}${server}/${volume}/bb1 > ${TMP_JSON}
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInBytes' ${TMP_JSON}
-                    Should Be Equal     ${result}       -1
-    ${result} =     Execute             jq -r '. | select(.name=="bb1") | 
.quotaInNamespace' ${TMP_JSON}
-                    Should Be Equal     ${result}       -1
-                    Execute             ozone sh bucket delete 
${protocol}${server}/${volume}/bb1
-                    Execute             ozone sh volume delete 
${protocol}${server}/${volume}
+    Execute Later ozone sh    volume setquota ${protocol}${server}/${volume} 
--space-quota 10TB --namespace-quota 100
+#    ${result} =     Execute Later ozone sh    volume info 
${protocol}${server}/${volume}
+#    ${filter} =     Set Variable    jq -r '. | 
select(.volumeName=="${volume}") | .owner | .name'
+#                    Assert Later    File ${result} Filtered By ${filter} 
Should    Be Equal     bill
+
+    ${result} =     Execute Later ozone sh    volume info 
${protocol}${server}/${volume}
+    ${filter} =     Set Variable    jq -r '. | select(.name=="${volume}") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   10995116277760
+
+    Execute Later and Expect No Output For ozone sh    bucket create 
${protocol}${server}/${volume}/bb1 --space-quota 10TB --namespace-quota 100
+
+    ${result} =     Execute Later ozone sh    bucket info 
${protocol}${server}/${volume}/bb1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.storageType'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   DISK
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   10995116277760
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   100
+
+    Execute Later ozone sh    bucket setquota 
${protocol}${server}/${volume}/bb1 --space-quota 1TB --namespace-quota 1000
+    ${result} =     Execute Later ozone sh    bucket info 
${protocol}${server}/${volume}/bb1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   1099511627776
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   1000
+
+    ${result} =     Execute Later ozone sh    bucket list 
${protocol}${server}/${volume}/
+    ${filter} =     Set Variable    jq -r '.[] | select(.name=="bb1") | 
.volumeName'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   ${volume}
+
+    Test key handling    ${protocol}    ${server}    ${volume}
+
+    Execute Later ozone sh    volume clrquota --space-quota 
${protocol}${server}/${volume}
+    ${result} =     Execute Later ozone sh    volume info 
${protocol}${server}/${volume}
+    ${filter} =     Set Variable    jq -r '. | select(.name=="${volume}") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later ozone sh    volume clrquota --namespace-quota 
${protocol}${server}/${volume}
+    ${result} =     Execute Later ozone sh    volume info 
${protocol}${server}/${volume}
+    ${filter} =     Set Variable    jq -r '. | select(.name=="${volume}") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later ozone sh    bucket clrquota --space-quota 
${protocol}${server}/${volume}/bb1
+    ${result} =     Execute Later ozone sh    bucket info 
${protocol}${server}/${volume}/bb1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later ozone sh    bucket clrquota --namespace-quota 
${protocol}${server}/${volume}/bb1
+    ${result} =     Execute Later ozone sh    bucket info 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later ozone sh    bucket delete -r --yes 
${protocol}${server}/${volume}/bb1
+    Execute Later ozone sh    volume delete ${protocol}${server}/${volume}
+    Assert Later Volume Does Not Exist    ${protocol}${server}/${volume}
+
+    Execute Later and Expect No Output For ozone sh    volume create 
${protocol}${server}/${volume}
+    ${result} =     Execute Later ozone sh    volume info 
${protocol}${server}/${volume}
+    ${filter} =     Set Variable    jq -r '. | select(.name=="${volume}") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="${volume}") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later and Expect No Output For ozone sh    bucket create 
${protocol}${server}/${volume}/bb1
+    ${result} =     Execute Later ozone sh    bucket info 
${protocol}${server}/${volume}/bb1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInBytes'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+    ${filter} =     Set Variable    jq -r '. | select(.name=="bb1") | 
.quotaInNamespace'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   -1
+
+    Execute Later ozone sh    bucket delete ${protocol}${server}/${volume}/bb1
+    Execute Later ozone sh    volume delete ${protocol}${server}/${volume}
+    Assert Later Volume Does Not Exist    ${protocol}${server}/${volume}
 
 Test ozone shell errors
     [arguments]     ${protocol}         ${server}       ${volume}
+    ${result} =     Execute and checkrc    ozone sh volume info 
${protocol}${server}/${volume}      255
+                    Should contain      ${result}       VOLUME_NOT_FOUND
     ${result} =     Execute and checkrc    ozone sh volume create 
${protocol}${server}/${volume} --space-quota 1.5GB      255
                     Should contain      ${result}       1.5GB is invalid
     ${result} =     Execute and checkrc    ozone sh volume create 
${protocol}${server}/${volume} --namespace-quota 1.5      255
@@ -138,177 +161,255 @@ Test ozone shell errors
 
 Test Volume Acls
     [arguments]     ${protocol}         ${server}       ${volume}
-    Execute         ozone sh volume create ${protocol}${server}/${volume}
-    ${result} =     Execute             ozone sh volume getacl 
${protocol}${server}/${volume}
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .aclScope=="ACCESS" and (.aclList | 
contains(["ALL"]))) | .name'
-    Should Not Be Empty    ${acl_check}
-    ${result} =     Execute             ozone sh volume addacl 
${protocol}${server}/${volume} -a user:superuser1:rwxy[DEFAULT]
-    ${result} =     Execute             ozone sh volume getacl 
${protocol}${server}/${volume}
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh volume removeacl 
${protocol}${server}/${volume} -a user:superuser1:xy
-    ${result} =     Execute             ozone sh volume getacl 
${protocol}${server}/${volume}
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh volume setacl 
${protocol}${server}/${volume} -al 
user:superuser1:rwxy[DEFAULT],group:superuser1:a,user:testuser:rwxyc,group:superuser1:a[DEFAULT]
-    ${result} =     Execute             ozone sh volume getacl 
${protocol}${server}/${volume}
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="GROUP" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["ALL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
+
+    Execute Later ozone sh    volume create ${protocol}${server}/${volume}
+
+    ${result} =     Execute Later ozone sh    volume getacl 
${protocol}${server}/${volume}
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.aclScope=="ACCESS" and (.aclList | contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Not Be 
Equal    ${EMPTY}
+
+    ${result} =     Execute Later ozone sh    volume addacl 
${protocol}${server}/${volume} -a user:superuser1:rwxy[DEFAULT]
+    ${result} =     Execute Later ozone sh    volume getacl 
${protocol}${server}/${volume}
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    volume removeacl 
${protocol}${server}/${volume} -a user:superuser1:xy
+    ${result} =     Execute Later ozone sh    volume getacl 
${protocol}${server}/${volume}
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    volume setacl 
${protocol}${server}/${volume} -al 
user:superuser1:rwxy[DEFAULT],group:superuser1:a,user:testuser:rwxyc,group:superuser1:a[DEFAULT]
+    ${result} =     Execute Later ozone sh    volume getacl 
${protocol}${server}/${volume}
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="GROUP" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | 
contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
 
 Test Bucket Acls
     [arguments]     ${protocol}         ${server}       ${volume}
-    Execute         ozone sh bucket create ${protocol}${server}/${volume}/bb1
-    ${result} =     Execute             ozone sh bucket getacl 
${protocol}${server}/${volume}/bb1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .aclScope=="ACCESS" and (.aclList | 
contains(["ALL"]))) | .name'
-    Should Not Be Empty    ${acl_check}
-    ${result} =     Execute             ozone sh bucket addacl 
${protocol}${server}/${volume}/bb1 -a user:superuser1:rwxy
-    ${result} =     Execute             ozone sh bucket getacl 
${protocol}${server}/${volume}/bb1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh bucket removeacl 
${protocol}${server}/${volume}/bb1 -a user:superuser1:xy
-    ${result} =     Execute             ozone sh bucket getacl 
${protocol}${server}/${volume}/bb1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh bucket setacl 
${protocol}${server}/${volume}/bb1 -al 
user:superuser1:rwxy,group:superuser1:a,user:testuser:rwxyc,group:superuser1:a[DEFAULT]
-    ${result} =     Execute             ozone sh bucket getacl 
${protocol}${server}/${volume}/bb1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="GROUP" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["ALL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
+
+    Execute Later ozone sh    bucket create ${protocol}${server}/${volume}/bb1
+
+    ${result} =     Execute Later ozone sh    bucket getacl 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.aclScope=="ACCESS" and (.aclList | contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Not Be 
Equal    ${EMPTY}
+
+    ${result} =     Execute Later ozone sh    bucket addacl 
${protocol}${server}/${volume}/bb1 -a user:superuser1:rwxy
+    ${result} =     Execute Later ozone sh    bucket getacl 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    bucket removeacl 
${protocol}${server}/${volume}/bb1 -a user:superuser1:xy
+    ${result} =     Execute Later ozone sh    bucket getacl 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    bucket setacl 
${protocol}${server}/${volume}/bb1 -al 
user:superuser1:rwxy,group:superuser1:a,user:testuser:rwxyc,group:superuser1:a[DEFAULT]
+    ${result} =     Execute Later ozone sh    bucket getacl 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="GROUP" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | 
contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
 
 Test key handling
     [arguments]     ${protocol}         ${server}       ${volume}
-                    Execute             rm -f /tmp/NOTICE.txt.1 
/tmp/key1_RATIS /tmp/key1-copy
-                    Ozone Shell Batch   key put 
${protocol}${server}/${volume}/bb1/key1 /opt/hadoop/NOTICE.txt
-                    ...                 key get 
${protocol}${server}/${volume}/bb1/key1 /tmp/NOTICE.txt.1
-                    ...                 key put -t RATIS 
${protocol}${server}/${volume}/bb1/key1_RATIS /opt/hadoop/NOTICE.txt
-                    ...                 key get 
${protocol}${server}/${volume}/bb1/key1_RATIS /tmp/key1_RATIS
-                    ...                 key cp 
${protocol}${server}/${volume}/bb1 key1 key1-copy
-                    ...                 key get 
${protocol}${server}/${volume}/bb1/key1-copy /tmp/key1-copy
-                    Execute             diff -q /opt/hadoop/NOTICE.txt 
/tmp/NOTICE.txt.1
-                    Execute             diff -q /opt/hadoop/NOTICE.txt 
/tmp/key1_RATIS
-
-    ${result} =     Execute             ozone sh key info 
${protocol}${server}/${volume}/bb1/key1_RATIS | jq -r '. | 
select(.name=="key1_RATIS")'
-                    Should contain      ${result}       RATIS
-
-                    Execute             diff -q /opt/hadoop/NOTICE.txt 
/tmp/key1-copy
-
-    ${result} =     Execute And Ignore Error    ozone sh key get 
${protocol}${server}/${volume}/bb1/key1 /tmp/NOTICE.txt.1
-                    Should Contain      ${result}       NOTICE.txt.1 exists
-    ${result} =     Execute             ozone sh key get --force 
${protocol}${server}/${volume}/bb1/key1 /tmp/NOTICE.txt.1
-                    Should Not Contain  ${result}       NOTICE.txt.1 exists
-    ${result} =     Execute and checkrc    ozone sh key put 
${protocol}${server}/${volume}/bb1/key1 sample.txt          255
-                    Should Contain         ${result}       File not found: 
sample.txt
-    ${result} =     Execute             ozone sh key info 
${protocol}${server}/${volume}/bb1/key1 | jq -r '. | select(.name=="key1")'
-                    Should contain      ${result}       creationTime
-                    Should not contain  ${result}       ETag
-    ${result} =     Execute             ozone sh key list 
${protocol}${server}/${volume}/bb1 | jq -r '.[] | select(.name=="key1") | .name'
-                    Should Be Equal     ${result}       key1
-                    Execute             ozone sh key rename 
${protocol}${server}/${volume}/bb1 key1 key2
-    ${result} =     Execute             ozone sh key list 
${protocol}${server}/${volume}/bb1 | jq -r '.[] | select(.name=="key2") | .name'
-                    Should Be Equal     ${result}       key2
-                    Ozone Shell Batch   key delete 
${protocol}${server}/${volume}/bb1/key2
-                    ...                 key delete 
${protocol}${server}/${volume}/bb1/key1_RATIS
-                    ...                 key delete 
${protocol}${server}/${volume}/bb1/key1-copy
+
+    ${key0_src} =    Set Variable    /etc/passwd
+    Put and Get Key Later    ${protocol}${server}/${volume}/bb1/key0    
put_from=${key0_src}
+
+    ${key1_src} =    Set Variable    /opt/hadoop/NOTICE.txt
+    Put and Get Key Later    ${protocol}${server}/${volume}/bb1/key1    
put_from=${key1_src}
+
+    Execute Later ozone sh    key put -t RATIS 
${protocol}${server}/${volume}/bb1/key1_ratis ${key1_src}
+    ${file2} =    Get Key Later    
${protocol}${server}/${volume}/bb1/key1_ratis
+    Assert Later    Compare Files    ${key1_src}    ${file2}
+
+    Execute Later ozone sh    key cp ${protocol}${server}/${volume}/bb1 key1 
key1-copy
+    ${key1_copy} =    Get Key Later    
${protocol}${server}/${volume}/bb1/key1-copy
+    Assert Later    Compare Files    ${key1_src}    ${key1_copy}
+
+    ${result} =    Execute Later ozone sh    key info 
${protocol}${server}/${volume}/bb1/key1_ratis
+    ${filter} =    Set Variable    jq -r '. | select(.name=="key1_ratis")'
+    Assert Later    File ${result} Filtered By ${filter} Should    Contain    
RATIS
+
+    # get does not overwrite existing local
+    ${existing_local} =    Get Key Later    
${protocol}${server}/${volume}/bb1/key0
+    ${result} =    Execute Later ozone sh    key get 
${protocol}${server}/${volume}/bb1/key1 ${existing_local}
+    Assert Later    File ${result} Should    Contain    ${existing_local} 
exists
+    Assert Later    Compare Files    ${key0_src}    ${existing_local}
+
+    # get --force overwrites existing local
+    ${gets_overwritten} =    Get Key Later    
${protocol}${server}/${volume}/bb1/key0
+    ${result} =    Execute Later ozone sh    key get --force 
${protocol}${server}/${volume}/bb1/key1 ${gets_overwritten}
+    Assert Later    File ${result} Should    Not Contain    
${gets_overwritten} exists
+    Assert Later    Compare Files    ${key1_src}    ${gets_overwritten}
+
+    ${result} =    Execute Later ozone sh    key put 
${protocol}${server}/${volume}/bb1/key1 no-such-file
+    Assert Later    File ${result} Should    Contain    File not found: 
no-such-file
+
+    ${result} =    Execute Later ozone sh    key info 
${protocol}${server}/${volume}/bb1/key1
+    ${filter} =    Set Variable    jq -r '. | select(.name=="key1")'
+    Assert Later    File ${result} Filtered By ${filter} Should
+    ...    Contain        creationTime
+    ...    Not Contain    ETag
+
+    ${result} =    Execute Later ozone sh    key list 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.name=="key1") | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   key1
+
+    Execute Later ozone sh    key rename ${protocol}${server}/${volume}/bb1 
key1 key2
+    ${result} =     Execute Later ozone sh    key list 
${protocol}${server}/${volume}/bb1
+    ${filter} =    Set Variable    jq -r '.[] | select(.name=="key2") | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
   key2
+
+    Execute Later ozone sh    key delete 
${protocol}${server}/${volume}/bb1/key2
+    Execute Later ozone sh    key delete 
${protocol}${server}/${volume}/bb1/key1_ratis
+    Execute Later ozone sh    key delete 
${protocol}${server}/${volume}/bb1/key1-copy
 
 Test key Acls
     [arguments]     ${protocol}         ${server}       ${volume}
-    Execute         ozone sh key put ${protocol}${server}/${volume}/bb1/key2 
/opt/hadoop/NOTICE.txt
-    ${result} =     Execute             ozone sh key getacl 
${protocol}${server}/${volume}/bb1/key2
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .aclScope=="ACCESS" and (.aclList | 
contains(["ALL"]))) | .name'
-    Should Not Be Empty    ${acl_check}
-    ${result} =     Execute             ozone sh key addacl 
${protocol}${server}/${volume}/bb1/key2 -a user:superuser1:rwxy
-    ${result} =     Execute             ozone sh key getacl 
${protocol}${server}/${volume}/bb1/key2
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh key removeacl 
${protocol}${server}/${volume}/bb1/key2 -a user:superuser1:xy
-    ${result} =     Execute             ozone sh key getacl 
${protocol}${server}/${volume}/bb1/key2
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh key setacl 
${protocol}${server}/${volume}/bb1/key2 -al 
user:superuser1:rwxy,group:superuser1:a,user:testuser:rwxyc
-    ${result} =     Execute             ozone sh key getacl 
${protocol}${server}/${volume}/bb1/key2
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="GROUP" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["ALL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
+
+    Execute Later ozone sh    key put ${protocol}${server}/${volume}/bb1/key2 
/opt/hadoop/NOTICE.txt
+
+    ${result} =     Execute Later ozone sh    key getacl 
${protocol}${server}/${volume}/bb1/key2
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.aclScope=="ACCESS" and (.aclList | contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Not Be 
Equal    ${EMPTY}
+
+    ${result} =     Execute Later ozone sh    key addacl 
${protocol}${server}/${volume}/bb1/key2 -a user:superuser1:rwxy
+    ${result} =     Execute Later ozone sh    key getacl 
${protocol}${server}/${volume}/bb1/key2
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    key removeacl 
${protocol}${server}/${volume}/bb1/key2 -a user:superuser1:xy
+    ${result} =     Execute Later ozone sh    key getacl 
${protocol}${server}/${volume}/bb1/key2
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    key setacl 
${protocol}${server}/${volume}/bb1/key2 -al 
user:superuser1:rwxy,group:superuser1:a,user:testuser:rwxyc
+    ${result} =     Execute Later ozone sh    key getacl 
${protocol}${server}/${volume}/bb1/key2
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="GROUP" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["ALL"]))) 
| .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
 
 Test prefix Acls
     [arguments]     ${protocol}         ${server}       ${volume}
-    Execute         ozone sh prefix addacl 
${protocol}${server}/${volume}/bb1/prefix1/ -a user:superuser1:rwxy[DEFAULT]
-    ${result} =     Execute             ozone sh prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh prefix removeacl 
${protocol}${server}/${volume}/bb1/prefix1/ -a user:superuser1:xy
-    ${result} =     Execute             ozone sh prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${result} =     Execute             ozone sh prefix setacl 
${protocol}${server}/${volume}/bb1/prefix1/ -al 
user:superuser1:rwxy[DEFAULT],group:superuser1:a[DEFAULT],user:testuser:rwxyc
-    ${result} =     Execute             ozone sh prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="GROUP" and .name=="superuser1" and .aclScope=="DEFAULT" and 
(.aclList | contains(["ALL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    Execute         ozone sh key put 
${protocol}${server}/${volume}/bb1/prefix1/key1 /opt/hadoop/NOTICE.txt
-    ${result} =     Execute             ozone sh key getacl 
${protocol}${server}/${volume}/bb1/prefix1/key1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="USER" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["READ", "WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
-    ${acl_check} =  Execute             echo '${result}' | jq -r '.[] | 
select(.type=="GROUP" and .name=="superuser1" and .aclScope=="ACCESS" and 
(.aclList | contains(["ALL"]))) | .name'
-    Should Be Equal    ${acl_check}    superuser1
+
+    Execute Later ozone sh    prefix addacl 
${protocol}${server}/${volume}/bb1/prefix1/ -a user:superuser1:rwxy[DEFAULT]
+
+    ${result} =     Execute Later ozone sh    prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    prefix removeacl 
${protocol}${server}/${volume}/bb1/prefix1/ -a user:superuser1:xy
+    ${result} =     Execute Later ozone sh    prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${result} =     Execute Later ozone sh    prefix setacl 
${protocol}${server}/${volume}/bb1/prefix1/ -al 
user:superuser1:rwxy[DEFAULT],group:superuser1:a[DEFAULT],user:testuser:rwxyc
+    ${result} =     Execute Later ozone sh    prefix getacl 
${protocol}${server}/${volume}/bb1/prefix1/
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="GROUP" and 
.name=="superuser1" and .aclScope=="DEFAULT" and (.aclList | 
contains(["ALL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    Execute Later ozone sh    key put 
${protocol}${server}/${volume}/bb1/prefix1/key1 /opt/hadoop/NOTICE.txt
+    ${result} =     Execute Later ozone sh    key getacl 
${protocol}${server}/${volume}/bb1/prefix1/key1
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="USER" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["READ", 
"WRITE", "READ_ACL", "WRITE_ACL"]))) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
+
+    ${filter} =    Set Variable    jq -r '.[] | select(.type=="GROUP" and 
.name=="superuser1" and .aclScope=="ACCESS" and (.aclList | contains(["ALL"]))) 
| .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Be Equal    
superuser1
 
 Test native authorizer
     [arguments]     ${protocol}         ${server}       ${volume}
 
     Return From Keyword if    '${SECURITY_ENABLED}' == 'false'
 
-    Execute         ozone sh volume removeacl ${protocol}${server}/${volume} 
-a group:root:a
-    Execute         kdestroy
-    Run Keyword     Kinit test user     testuser2    testuser2.keytab
-    ${result} =     Execute And Ignore Error         ozone sh bucket list 
${protocol}${server}/${volume}
-                    Should contain      ${result}    PERMISSION_DENIED
-    ${result} =     Execute And Ignore Error         ozone sh key list 
${protocol}${server}/${volume}/bb1
-                    Should contain      ${result}    PERMISSION_DENIED
-    ${result} =     Execute And Ignore Error         ozone sh volume addacl 
${protocol}${server}/${volume} -a user:testuser2:xy
-                    Should contain      ${result}    PERMISSION_DENIED User 
testuser2 doesn't have WRITE_ACL permission to access volume
-    Execute         kdestroy
-    Run Keyword     Kinit test user     testuser     testuser.keytab
-    Execute         ozone sh volume addacl ${protocol}${server}/${volume} -a 
user:testuser2:xyrw
-    Execute         kdestroy
-    Run Keyword     Kinit test user     testuser2    testuser2.keytab
-    ${result} =     Execute And Ignore Error         ozone sh bucket list 
${protocol}${server}/${volume}
-                    Should contain      ${result}    PERMISSION_DENIED User 
testuser2 doesn't have LIST permission to access volume
-    Execute         ozone sh volume addacl ${protocol}${server}/${volume} -a 
user:testuser2:l
-    Execute         ozone sh bucket list ${protocol}${server}/${volume}
-    Execute         ozone sh volume getacl ${protocol}${server}/${volume}
-
-    ${result} =     Execute And Ignore Error         ozone sh key list 
${protocol}${server}/${volume}/bb1
-    Should contain      ${result}    PERMISSION_DENIED
-    Execute         kdestroy
-    Run Keyword     Kinit test user     testuser     testuser.keytab
-    Execute         ozone sh bucket addacl ${protocol}${server}/${volume}/bb1 
-a user:testuser2:a
-    Execute         ozone sh bucket getacl ${protocol}${server}/${volume}/bb1
+    # setup with testuser
+
+    ${expected} =    Get test user principal    testuser
+    Should Be Equal    ${TEST_USER}    ${expected}
+
+    # no access
+    ${vol1} =    Set Variable    ${protocol}${server}/${volume}1
+    Execute Later ozone sh    volume create ${vol1}
+    Execute Later ozone sh    volume removeacl ${vol1} -a group:root:a
+    Execute Later ozone sh    bucket create ${vol1}/bb1
+
+    # no list
+    ${vol2} =    Set Variable    ${protocol}${server}/${volume}2
+    Execute Later ozone sh    volume create ${vol2}
+    Execute Later ozone sh    volume removeacl ${vol2} -a group:root:a
+    Execute Later ozone sh    volume addacl ${vol2} -a user:testuser2:xyrw
+    Execute Later ozone sh    bucket create ${vol2}/bb1
+
+    # all access to bucket
+    ${vol3} =    Set Variable    ${protocol}${server}/${volume}3
+    Execute Later ozone sh    volume create ${vol3}
+    Execute Later ozone sh    volume removeacl ${vol3} -a group:root:a
+    Execute Later ozone sh    volume addacl ${vol3} -a user:testuser2:xyrw
+    Execute Later ozone sh    bucket create ${vol3}/bb1
+    Execute Later ozone sh    bucket addacl ${vol3}/bb1 -a user:testuser2:a
+
+    Execute Batch
+
+    # tests with testuser2
+
     Execute         kdestroy
-    Run Keyword     Kinit test user     testuser2    testuser2.keytab
-    Execute         ozone sh bucket getacl ${protocol}${server}/${volume}/bb1
-    Execute         ozone sh key list ${protocol}${server}/${volume}/bb1
+    Kinit test user     testuser2    testuser2.keytab
+
+    # no access
+    ${result} =     Execute Later ozone sh    bucket list ${vol1}
+    Assert Later    File ${result} Should    Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    key list ${vol1}/bb1
+    Assert Later    File ${result} Should    Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    volume addacl ${vol1} -a 
user:testuser2:xy
+    Assert Later    File ${result} Should    Contain    PERMISSION_DENIED User 
testuser2 doesn't have WRITE_ACL permission to access volume
+
+    # no list
+    ${result} =     Execute Later ozone sh    bucket list ${vol2}
+    Assert Later    File ${result} Should    Contain    PERMISSION_DENIED User 
testuser2 doesn't have LIST permission to access volume
+    ${result} =     Execute Later ozone sh    volume addacl ${vol2} -a 
user:testuser2:l
+    Assert Later    File ${result} Should    Not Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    bucket list ${vol2}
+    Assert Later    File ${result} Should    Not Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    volume getacl ${vol2}
+    Assert Later    File ${result} Should    Not Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    key list ${vol2}/bb1
+    Assert Later    File ${result} Should    Contain    PERMISSION_DENIED
+
+    # all access to bucket
+    ${result} =     Execute Later ozone sh    bucket getacl ${vol3}/bb1
+    Assert Later    File ${result} Should    Not Contain    PERMISSION_DENIED
+    ${result} =     Execute Later ozone sh    key list ${vol3}/bb1
+    Assert Later    File ${result} Should    Not Contain    PERMISSION_DENIED
+
+    Execute Batch
     Execute         kdestroy
-    Run Keyword     Kinit test user     testuser    testuser.keytab
+
 
 Test Delete key with Trash
     [arguments]    ${protocol}         ${server}       ${volume}
-                   Ozone Shell Batch     volume create 
${protocol}${server}/${volume}
-                   ...                   bucket create 
${protocol}${server}/${volume}/bfso --layout FILE_SYSTEM_OPTIMIZED
-                   ...                   key put -t RATIS 
${protocol}${server}/${volume}/bfso/key3 /opt/hadoop/NOTICE.txt
-                   ...                   key delete 
${protocol}${server}/${volume}/bfso/key3
-    ${fsokey} =    Execute               ozone sh key list 
${protocol}${server}/${volume}/bfso
-    ${result} =    Execute               echo '${fsokey}' | jq -r '.[] | 
select(.name | startswith(".Trash")) | .name'
-                   Should Contain Any    ${result}    .Trash/hadoop    
.Trash/testuser    .Trash/root
-                   Should contain        ${result}    key3
-    ${result} =    Execute               echo '${fsokey}' | jq -r '.[] | 
select(.name | startswith(".Trash") | not) | .name'
-                   Should Not contain    ${result}    key3
-                   Ozone Shell Batch     bucket create 
${protocol}${server}/${volume}/obsbkt --layout OBJECT_STORE
-                   ...                   key put -t RATIS 
${protocol}${server}/${volume}/obsbkt/key2 /opt/hadoop/NOTICE.txt
-                   ...                   key delete 
${protocol}${server}/${volume}/obsbkt/key2
-    ${result} =    Execute               ozone sh key list 
${protocol}${server}/${volume}/obsbkt
-                   Should not contain    ${result}    key2
+
+    Execute Later ozone sh    volume create ${protocol}${server}/${volume}
+    Execute Later ozone sh    bucket create 
${protocol}${server}/${volume}/bfso --layout FILE_SYSTEM_OPTIMIZED
+    Execute Later ozone sh    key put -t RATIS 
${protocol}${server}/${volume}/bfso/key3 /opt/hadoop/NOTICE.txt
+    Execute Later ozone sh    key delete 
${protocol}${server}/${volume}/bfso/key3
+
+    ${result} =    Execute Later ozone sh    key list 
${protocol}${server}/${volume}/bfso
+    ${filter} =    Set Variable    jq -r '.[] | select(.name | 
startswith(".Trash")) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Contain     
     key3
+
+    ${filter} =    Set Variable    jq -r '.[] | select(.name | 
startswith(".Trash") | not) | .name'
+    Assert Later    File ${result} Filtered By ${filter} Should    Not contain 
     key3
+
+    Execute Later ozone sh    bucket create 
${protocol}${server}/${volume}/obsbkt --layout OBJECT_STORE
+    Execute Later ozone sh    key put -t RATIS 
${protocol}${server}/${volume}/obsbkt/key2 /opt/hadoop/NOTICE.txt
+    Execute Later ozone sh    key delete 
${protocol}${server}/${volume}/obsbkt/key2
+
+    ${result} =    Execute Later ozone sh    key list 
${protocol}${server}/${volume}/obsbkt
+    Assert Later    File ${result} Should    not contain      key2
diff --git 
a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot 
b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot
index ab2a50b6aa6..16dc8607a31 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot
@@ -18,8 +18,21 @@ Documentation       Test ozone shell CLI usage
 Library             OperatingSystem
 Resource            ../commonlib.robot
 Resource            ozone-shell-lib.robot
+Resource            ../ozone-lib/batch.robot
 Test Timeout        10 minutes
-Suite Setup         Generate prefix
+Suite Setup         Setup Suite
+Suite Teardown      Teardown Suite
+
+*** Keywords ***
+Setup Suite
+    Get Security Enabled From Config
+    Generate prefix
+    Setup Batch
+    Kinit test user
+
+Teardown Suite
+    Teardown Batch
+
 
 *** Test Cases ***
 
diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot 
b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
index bd61c8a2fd7..fff8729fbd7 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
@@ -18,18 +18,28 @@ Documentation       Test ozone shell CLI usage
 Library             OperatingSystem
 Resource            ../commonlib.robot
 Resource            ozone-shell-lib.robot
-Test Setup          Run Keyword if    '${SECURITY_ENABLED}' == 'true'    Kinit 
test user     testuser     testuser.keytab
+Resource            ../ozone-lib/batch.robot
 Test Timeout        10 minutes
-Suite Setup         Run Keywords    Generate prefix
-...                 AND             Get Security Enabled From Config
+Suite Setup         Setup Suite
+Suite Teardown      Teardown Suite
 
-*** Test Cases ***
-RpcClient with port
-   Test ozone shell       o3://            om:9862     ${prefix}-with-host
+*** Keywords ***
+Setup Suite
+    Get Security Enabled From Config
+    Generate prefix
+    Setup Batch
+    Kinit test user
 
+Teardown Suite
+    Teardown Batch
+
+*** Test Cases ***
 RpcClient with execution errors
    Test ozone shell errors    o3://        om:9862     ${prefix}-with-errors
 
+RpcClient with port
+   Test ozone shell       o3://            om:9862     ${prefix}-with-host
+
 RpcClient volume acls
    Test Volume Acls       o3://            om:9862     ${prefix}-acls
 
@@ -39,10 +49,6 @@ RpcClient bucket acls
 RpcClient key acls
     Test Key Acls         o3://            om:9862     ${prefix}-acls
 
-# depends on being run between key and prefix tests
-Test native authorizer
-    Test native authorizer    o3://    om:9862    ${prefix}-acls
-
 RpcClient prefix acls
     Test Prefix Acls      o3://            om:9862     ${prefix}-acls
 
@@ -51,3 +57,7 @@ RpcClient without host
 
 RpcClient Delete key
    Test Delete key with Trash       o3://            om:9862      
${prefix}-with-del
+
+Test native authorizer with other user
+    Skip If   '${SECURITY_ENABLED}' != 'true'    only if security is enabled
+    Test native authorizer    o3://    om:9862    ${prefix}-testuser2
diff --git a/hadoop-ozone/dist/src/main/smoketest/lib/os.robot 
b/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
index 2597c4f9956..df5f5907f27 100644
--- a/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/lib/os.robot
@@ -67,6 +67,15 @@ List All Processes
     ${output} =    Execute    ps aux
     [return]    ${output}
 
+File ${file} Filtered By ${filter} Should
+    [arguments]    @{args}
+    File Should Exist    ${file}
+    ${output} =    Execute    cat ${file} | ${filter}
+    Log    ${output}
+    FOR    ${keyword}    ${arg}    IN    @{args}
+        Run Keyword    Should ${keyword}    ${output}    ${arg}
+    END
+
 File ${file} Should
     [arguments]    @{args}
     File Should Exist    ${file}
diff --git 
a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot 
b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch-shell.robot
similarity index 50%
copy from hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot
copy to hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch-shell.robot
index ab2a50b6aa6..dad6718f953 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-single.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch-shell.robot
@@ -14,14 +14,25 @@
 # limitations under the License.
 
 *** Settings ***
-Documentation       Test ozone shell CLI usage
-Library             OperatingSystem
-Resource            ../commonlib.robot
-Resource            ozone-shell-lib.robot
-Test Timeout        10 minutes
-Suite Setup         Generate prefix
+Documentation    Ozone Shell operations using Batch
+Resource         ../ozone-lib/batch.robot
 
-*** Test Cases ***
 
-Test ozone shell
-   Test ozone shell       ${EMPTY}            ${EMPTY}     
${prefix}-without-scheme
+*** Keywords ***
+Put and Get Key Later
+    [arguments]    ${put_to}    ${get_from}=${put_to}    
${put_from}=/etc/passwd
+    Execute Later ozone sh    key put ${put_to} ${put_from}
+    ${get_to} =    Get Key Later    ${get_from}
+    Assert Later    Compare Files    ${put_from}    ${get_to}
+
+
+Get Key Later
+    [arguments]    ${get_from}
+    ${get_to} =    Get Next Filename    ${BATCH_OUTPUT_DIR}/key-get
+    Execute Later ozone sh    key get -f ${get_from} ${get_to}
+    [return]    ${get_to}
+
+Assert Later Volume Does Not Exist
+    [arguments]    ${volume}
+    ${result} =     Execute Later ozone sh    volume info ${volume}
+    Assert Later    File ${result} Should    Contain    VOLUME_NOT_FOUND
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 6b7600fb094..ba25303a977 100644
--- a/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/ozone-lib/batch.robot
@@ -91,6 +91,12 @@ Assert Later
     END
 
 
+Execute Later and Expect No Output For ozone ${subcmd}
+    [arguments]    ${command}
+    ${file} =    Execute Later ozone ${subcmd}    ${command}
+    Assert Later    File ${file} Should    Be Equal    ${EMPTY}
+
+
 Execute Batch of Commands
     IF    '${BATCH_SUBCMD}' == '${EMPTY}'    RETURN
     Run Keyword    Ozone Batch ${BATCH_SUBCMD}    @{BATCH_COMMANDS}


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

Reply via email to