compat-in-docker.sh 1.9 KB

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