hadoop_bootstrap.bats 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. load hadoop-functions_test_helper
  16. @test "hadoop_bootstrap (no libexec)" {
  17. unset HADOOP_LIBEXEC_DIR
  18. run hadoop_bootstrap
  19. [ "${status}" -eq 1 ]
  20. }
  21. @test "hadoop_bootstrap (libexec)" {
  22. unset HADOOP_HOME
  23. unset HADOOP_COMMON_DIR
  24. unset HADOOP_COMMON_LIB_JARS_DIR
  25. unset HDFS_DIR
  26. unset HDFS_LIB_JARS_DIR
  27. unset YARN_DIR
  28. unset YARN_LIB_JARS_DIR
  29. unset MAPRED_DIR
  30. unset MAPRED_LIB_JARS_DIR
  31. unset HADOOP_TOOLS_HOME
  32. unset HADOOP_TOOLS_DIR
  33. unset HADOOP_TOOLS_LIB_JARS_DIR
  34. unset HADOOP_OS_TYPE
  35. hadoop_bootstrap
  36. # all of these should be set
  37. [ -n ${HADOOP_HOME} ]
  38. [ -n ${HADOOP_COMMON_DIR} ]
  39. [ -n ${HADOOP_COMMON_LIB_JARS_DIR} ]
  40. [ -n ${HDFS_DIR} ]
  41. [ -n ${HDFS_LIB_JARS_DIR} ]
  42. [ -n ${YARN_DIR} ]
  43. [ -n ${YARN_LIB_JARS_DIR} ]
  44. [ -n ${MAPRED_DIR} ]
  45. [ -n ${MAPRED_LIB_JARS_DIR} ]
  46. [ -n ${HADOOP_OS_TYPE} ]
  47. [ -n ${HADOOP_TOOLS_PATH} ]
  48. [ -n ${HADOOP_TOOLS_HOME} ]
  49. [ -n ${HADOOP_TOOLS_DIR} ]
  50. [ -n ${HADOOP_TOOLS_LIB_JARS_DIR} ]
  51. }