HDDS-47. Add acceptance tests for Ozone Shell.
Contributed by Lokesh Jain.

Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/62e6ba9b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/62e6ba9b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/62e6ba9b

Branch: refs/heads/HDDS-4
Commit: 62e6ba9bbffc17c6c9aab9c171d5a3710f83f7d3
Parents: 6f809c2
Author: Anu Engineer <aengin...@apache.org>
Authored: Fri May 11 10:20:04 2018 -0700
Committer: Xiaoyu Yao <x...@apache.org>
Committed: Mon May 14 10:31:09 2018 -0700

----------------------------------------------------------------------
 .../test/robotframework/acceptance/ozone.robot  | 24 ++++++++++++++++++--
 .../hadoop/ozone/client/OzoneClientUtils.java   |  1 +
 2 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/62e6ba9b/hadoop-ozone/acceptance-test/src/test/robotframework/acceptance/ozone.robot
----------------------------------------------------------------------
diff --git 
a/hadoop-ozone/acceptance-test/src/test/robotframework/acceptance/ozone.robot 
b/hadoop-ozone/acceptance-test/src/test/robotframework/acceptance/ozone.robot
index 1a9cee7..211ec4c 100644
--- 
a/hadoop-ozone/acceptance-test/src/test/robotframework/acceptance/ozone.robot
+++ 
b/hadoop-ozone/acceptance-test/src/test/robotframework/acceptance/ozone.robot
@@ -52,9 +52,29 @@ Test ozone cli
                     Execute on          datanode        ozone oz -createVolume 
http://ksm/hive -user bilbo -quota 100TB -root
     ${result} =     Execute on          datanode        ozone oz -listVolume 
o3://ksm -user bilbo | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r 
'.[] | select(.volumeName=="hive")'
                     Should contain      ${result}       createdOn
+                    Execute on          datanode        ozone oz -updateVolume 
http://ksm/hive -user bill -quota 10TB
+    ${result} =     Execute on          datanode        ozone oz -infoVolume 
http://ksm/hive | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | 
select(.volumeName=="hive") | .owner | .name'
+                    Should Be Equal     ${result}       bill
+    ${result} =     Execute on          datanode        ozone oz -infoVolume 
http://ksm/hive | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | 
select(.volumeName=="hive") | .quota | .size'
+                    Should Be Equal     ${result}       10
                     Execute on          datanode        ozone oz -createBucket 
http://ksm/hive/bb1
-    ${result}       Execute on          datanode        ozone oz -listBucket 
o3://ksm/hive/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | 
select(.bucketName=="bb1") | .volumeName'
+    ${result} =     Execute on          datanode        ozone oz -infoBucket 
http://ksm/hive/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. 
| select(.bucketName=="bb1") | .storageType'
+                    Should Be Equal     ${result}       DISK
+    ${result} =     Execute on          datanode        ozone oz -updateBucket 
http://ksm/hive/bb1 -addAcl user:frodo:rw,group:samwise:r | grep -Ev 
'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | 
.acls | .[] | select(.name=="samwise") | .type'
+                    Should Be Equal     ${result}       GROUP
+    ${result} =     Execute on          datanode        ozone oz -updateBucket 
http://ksm/hive/bb1 -removeAcl group:samwise:r | grep -Ev 
'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | 
.acls | .[] | select(.name=="frodo") | .type'
+                    Should Be Equal     ${result}       USER
+    ${result} =     Execute on          datanode        ozone oz -listBucket 
o3://ksm/hive/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | 
select(.bucketName=="bb1") | .volumeName'
                     Should Be Equal     ${result}       hive
+                    Execute on          datanode        ozone oz -putKey 
http://ksm/hive/bb1/key1 -file NOTICE.txt
+                    Execute on          datanode        rm -f NOTICE.txt.1
+                    Execute on          datanode        ozone oz -getKey 
http://ksm/hive/bb1/key1 -file NOTICE.txt.1
+                    Execute on          datanode        ls -l NOTICE.txt.1
+    ${result} =     Execute on          datanode        ozone oz -infoKey 
http://ksm/hive/bb1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq 
-r '. | select(.keyName=="key1")'
+                    Should contain      ${result}       createdOn
+    ${result} =     Execute on          datanode        ozone oz -listKey 
o3://ksm/hive/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] 
| select(.keyName=="key1") | .keyName'
+                    Should Be Equal     ${result}       key1
+                    Execute on          datanode        ozone oz -deleteKey 
http://ksm/hive/bb1/key1 -v
                     Execute on          datanode        ozone oz -deleteBucket 
http://ksm/hive/bb1
                     Execute on          datanode        ozone oz -deleteVolume 
http://ksm/hive -user bilbo
 
@@ -106,12 +126,12 @@ Scale datanodes up
 Execute on
     [arguments]     ${componentname}    ${command}
     ${rc}           ${return} =         Run docker compose          exec 
${componentname} ${command}
-    Log             ${return}
     [return]        ${return}
 
 Run docker compose
     [arguments]                     ${command}
                                     Set Environment Variable    HADOOPDIR      
                        ${basedir}/../../hadoop-dist/target/hadoop-${version}
     ${rc}                           ${output} =                 Run And Return 
Rc And Output           docker-compose -f 
${basedir}/target/compose/docker-compose.yaml ${command}
+    Log                             ${output}
     Should Be Equal As Integers     ${rc}                       0
     [return]                            ${rc}                       ${output}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62e6ba9b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientUtils.java
----------------------------------------------------------------------
diff --git 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientUtils.java
 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientUtils.java
index 5c83d9b..6be61e2 100644
--- 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientUtils.java
+++ 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientUtils.java
@@ -47,6 +47,7 @@ public final class OzoneClientUtils {
     bucketInfo.setStorageType(bucket.getStorageType());
     bucketInfo.setVersioning(
         OzoneConsts.Versioning.getVersioning(bucket.getVersioning()));
+    bucketInfo.setAcls(bucket.getAcls());
     return bucketInfo;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to