You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
981 B

  1. #!/bin/bash
  2. exname=$(basename $0)
  3. prefix_cmd="
  4. . /etc/shlib
  5. include common
  6. include parse
  7. . ../lib/common
  8. letsencrypt_get_challenge_type() {
  9. echo 'Calling letsencrypt_get_challenge_type' >&2
  10. echo \"\$LETSENCRYPT_GET_CHALLENGE_TYPE\"
  11. }
  12. export -f letsencrypt_get_challenge_type
  13. "
  14. try "
  15. LETSENCRYPT_GET_CHALLENGE_TYPE=foo
  16. get_challenge_type '' create "bar"
  17. "
  18. is errlvl 0
  19. is err "Warning: No challenge-type provided, defaulting to 'http'." RTRIM
  20. is out 'http' RTRIM
  21. try "
  22. LETSENCRYPT_GET_CHALLENGE_TYPE=foo
  23. get_challenge_type '
  24. challenge-type: wiz
  25. ' create "bar"
  26. "
  27. noerror
  28. is out 'wiz' RTRIM
  29. try "
  30. LETSENCRYPT_GET_CHALLENGE_TYPE=foo
  31. get_challenge_type '
  32. challenge-type: wiz
  33. ' renew "bar"
  34. "
  35. is errlvl 0
  36. is err 'Calling letsencrypt_get_challenge_type' RTRIM
  37. is out 'foo' RTRIM
  38. try "
  39. LETSENCRYPT_GET_CHALLENGE_TYPE=http-01
  40. get_challenge_type '
  41. challenge-type: wiz
  42. ' renew "bar"
  43. "
  44. is errlvl 0
  45. is err 'Calling letsencrypt_get_challenge_type' RTRIM
  46. is out 'http' RTRIM