ozone-shell.robot 5.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. *** Settings ***
  16. Documentation Test ozone shell CLI usage
  17. Library OperatingSystem
  18. Resource ../commonlib.robot
  19. Test Timeout 2 minute
  20. *** Variables ***
  21. *** Test Cases ***
  22. RpcClient with port
  23. Test ozone shell o3:// ozoneManager:9862 rpcwoport
  24. RpcClient without host
  25. Test ozone shell o3:// ${EMPTY} rpcwport
  26. RpcClient without scheme
  27. Test ozone shell ${EMPTY} ${EMPTY} rpcwoscheme
  28. *** Keywords ***
  29. Test ozone shell
  30. [arguments] ${protocol} ${server} ${volume}
  31. ${result} = Execute ozone sh volume create ${protocol}${server}/${volume} --user bilbo --quota 100TB --root
  32. Should not contain ${result} Failed
  33. Should contain ${result} Creating Volume: ${volume}
  34. ${result} = Execute ozone sh volume list ${protocol}${server}/ --user bilbo | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.volumeName=="${volume}")'
  35. Should contain ${result} createdOn
  36. ${result} = Execute ozone sh volume list --user bilbo | grep -Ev 'Removed|DEBUG|ERROR|INFO|TRACE|WARN' | jq -r '.[] | select(.volumeName=="${volume}")'
  37. Should contain ${result} createdOn
  38. Execute ozone sh volume update ${protocol}${server}/${volume} --user bill --quota 10TB
  39. ${result} = Execute ozone sh volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .owner | .name'
  40. Should Be Equal ${result} bill
  41. ${result} = Execute ozone sh volume info ${protocol}${server}/${volume} | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.volumeName=="${volume}") | .quota | .size'
  42. Should Be Equal ${result} 10
  43. Execute ozone sh bucket create ${protocol}${server}/${volume}/bb1
  44. ${result} = Execute ozone sh bucket info ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .storageType'
  45. Should Be Equal ${result} DISK
  46. ${result} = Execute ozone sh bucket update ${protocol}${server}/${volume}/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'
  47. Should Be Equal ${result} GROUP
  48. ${result} = Execute ozone sh bucket update ${protocol}${server}/${volume}/bb1 --removeAcl group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="frodo") | .type'
  49. Should Be Equal ${result} USER
  50. ${result} = Execute ozone sh bucket list ${protocol}${server}/${volume}/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.bucketName=="bb1") | .volumeName'
  51. Should Be Equal ${result} ${volume}
  52. Run Keyword Test key handling ${protocol} ${server} ${volume}
  53. Execute ozone sh bucket delete ${protocol}${server}/${volume}/bb1
  54. Execute ozone sh volume delete ${protocol}${server}/${volume} --user bilbo
  55. Test key handling
  56. [arguments] ${protocol} ${server} ${volume}
  57. Execute ozone sh key put ${protocol}${server}/${volume}/bb1/key1 /opt/hadoop/NOTICE.txt
  58. Execute rm -f NOTICE.txt.1
  59. Execute ozone sh key get ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt.1
  60. Execute ls -l NOTICE.txt.1
  61. ${result} = Execute ozone sh key info ${protocol}${server}/${volume}/bb1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.keyName=="key1")'
  62. Should contain ${result} createdOn
  63. ${result} = Execute ozone sh key list ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.keyName=="key1") | .keyName'
  64. Should Be Equal ${result} key1
  65. Execute ozone sh key rename ${protocol}${server}/${volume}/bb1 key1 key2
  66. ${result} = Execute ozone sh key list ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[].keyName'
  67. Should Be Equal ${result} key2
  68. Execute ozone sh key delete ${protocol}${server}/${volume}/bb1/key2