attr.t 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. . $(dirname "$0")/../misc.sh
  17. echo "Hello World!" > "${localDir}/dat"
  18. hadoop fs -put "${localDir}/dat" "${baseDir}/"
  19. echo "1..10"
  20. # 1. chown
  21. hadoop fs -chown "hadoop-compat-bench-user" "${baseDir}/dat"
  22. expect_out "chown" "user:hadoop-compat-bench-user" hadoop fs -stat "user:%u" "${baseDir}/dat"
  23. # 2. chgrp
  24. hadoop fs -chgrp "hadoop-compat-bench-group" "${baseDir}/dat"
  25. expect_out "chgrp" "group:hadoop-compat-bench-group" hadoop fs -stat "group:%g" "${baseDir}/dat"
  26. # 3. chmod
  27. hadoop fs -chmod 777 "${baseDir}/dat"
  28. expect_out "chmod" "perm:777" hadoop fs -stat "perm:%a" "${baseDir}/dat"
  29. # 4. touch
  30. hadoop fs -touch -m -t "20000615:000000" "${baseDir}/dat"
  31. expect_out "touch" "date:2000-06-.*" hadoop fs -stat "date:%y" "${baseDir}/dat"
  32. # 5. setfattr
  33. expect_ret "setfattr" 0 hadoop fs -setfattr -n "user.key" -v "value" "${baseDir}/dat"
  34. # 6. getfattr
  35. expect_out "getfattr" ".*value.*" hadoop fs -getfattr -n "user.key" "${baseDir}/dat"
  36. # 7. setfacl
  37. expect_ret "setfacl" 0 hadoop fs -setfacl -m "user:foo:---" "${baseDir}/dat"
  38. # 8. getfacl
  39. expect_out "getfacl" ".*foo.*" hadoop fs -getfacl "${baseDir}/dat"
  40. # 9. setrep
  41. hadoop fs -setrep 1 "${baseDir}/dat"
  42. expect_out "setrep" "replication:1" hadoop fs -stat "replication:%r" "${baseDir}/dat"
  43. # 10. checksum
  44. expect_ret "checksum" 0 hadoop fs -checksum "${baseDir}/dat" # TODO