ssl-opt-in-docker.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash -eu
  2. # ssl-opt-in-docker.sh
  3. #
  4. # Purpose
  5. # -------
  6. # This runs ssl-opt.sh in a Docker container.
  7. #
  8. # WARNING: the Dockerfile used by this script is no longer maintained! See
  9. # https://github.com/Mbed-TLS/mbedtls-test/blob/master/README.md#quick-start
  10. # for the set of Docker images we use on the CI.
  11. #
  12. # Notes for users
  13. # ---------------
  14. # If OPENSSL, GNUTLS_CLI, or GNUTLS_SERV are specified, the path must
  15. # correspond to an executable inside the Docker container. The special
  16. # values "next" and "legacy" are also allowed as shorthand for the
  17. # installations inside the container.
  18. #
  19. # See also:
  20. # - scripts/docker_env.sh for general Docker prerequisites and other information.
  21. # - ssl-opt.sh for notes about invocation of that script.
  22. # Copyright The Mbed TLS Contributors
  23. # SPDX-License-Identifier: Apache-2.0
  24. #
  25. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  26. # not use this file except in compliance with the License.
  27. # You may obtain a copy of the License at
  28. #
  29. # http://www.apache.org/licenses/LICENSE-2.0
  30. #
  31. # Unless required by applicable law or agreed to in writing, software
  32. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  33. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  34. # See the License for the specific language governing permissions and
  35. # limitations under the License.
  36. source tests/scripts/docker_env.sh
  37. case "${OPENSSL:-default}" in
  38. "legacy") export OPENSSL="/usr/local/openssl-1.0.1j/bin/openssl";;
  39. "next") export OPENSSL="/usr/local/openssl-1.1.1a/bin/openssl";;
  40. *) ;;
  41. esac
  42. case "${GNUTLS_CLI:-default}" in
  43. "legacy") export GNUTLS_CLI="/usr/local/gnutls-3.3.8/bin/gnutls-cli";;
  44. "next") export GNUTLS_CLI="/usr/local/gnutls-3.7.2/bin/gnutls-cli";;
  45. *) ;;
  46. esac
  47. case "${GNUTLS_SERV:-default}" in
  48. "legacy") export GNUTLS_SERV="/usr/local/gnutls-3.3.8/bin/gnutls-serv";;
  49. "next") export GNUTLS_SERV="/usr/local/gnutls-3.7.2/bin/gnutls-serv";;
  50. *) ;;
  51. esac
  52. run_in_docker \
  53. -e P_SRV \
  54. -e P_CLI \
  55. -e P_PXY \
  56. -e GNUTLS_CLI \
  57. -e GNUTLS_SERV \
  58. -e OPENSSL \
  59. tests/ssl-opt.sh \
  60. $@