hadoop_subcommand_secure_opts.bats 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_subcommand_secure_opts (missing param)" {
  17. HADOOP_OPTS="x"
  18. run hadoop_subcommand_secure_opts testvar
  19. [ "${status}" = "1" ]
  20. }
  21. @test "hadoop_subcommand_secure_opts (simple not exist)" {
  22. HADOOP_OPTS="x"
  23. hadoop_subcommand_secure_opts hadoop subcommand
  24. [ "${HADOOP_OPTS}" = "x" ]
  25. }
  26. @test "hadoop_subcommand_secure_opts (hadoop simple exist)" {
  27. HADOOP_OPTS="x"
  28. HADOOP_TEST_SECURE_EXTRA_OPTS="y"
  29. hadoop_subcommand_secure_opts hadoop test
  30. echo "${HADOOP_OPTS}"
  31. [ "${HADOOP_OPTS}" = "x y" ]
  32. }
  33. @test "hadoop_subcommand_secure_opts (hadoop complex exist)" {
  34. HADOOP_OPTS="x"
  35. HADOOP_TEST_SECURE_EXTRA_OPTS="y z"
  36. hadoop_subcommand_secure_opts hadoop test
  37. echo "${HADOOP_OPTS}"
  38. [ "${HADOOP_OPTS}" = "x y z" ]
  39. }
  40. @test "hadoop_subcommand_secure_opts (hdfs simple exist)" {
  41. HADOOP_OPTS="x"
  42. HDFS_TEST_SECURE_EXTRA_OPTS="y"
  43. hadoop_subcommand_secure_opts hdfs test
  44. echo "${HADOOP_OPTS}"
  45. [ "${HADOOP_OPTS}" = "x y" ]
  46. }