Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 1 | #!/bin/bash -eu |
| 2 | |
| 3 | # compat-in-docker.sh |
| 4 | # |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 5 | # Purpose |
| 6 | # ------- |
| 7 | # This runs compat.sh in a Docker container. |
| 8 | # |
Manuel Pégourié-Gonnard | 59626b6 | 2022-12-15 10:08:26 +0100 | [diff] [blame] | 9 | # WARNING: the Dockerfile used by this script is no longer maintained! See |
| 10 | # https://github.com/Mbed-TLS/mbedtls-test/blob/master/README.md#quick-start |
| 11 | # for the set of Docker images we use on the CI. |
| 12 | # |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 13 | # Notes for users |
| 14 | # --------------- |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 15 | # If OPENSSL, GNUTLS_CLI, or GNUTLS_SERV are specified the path must |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 16 | # correspond to an executable inside the Docker container. The special |
| 17 | # values "next" (OpenSSL only) and "legacy" are also allowed as shorthand |
| 18 | # for the installations inside the container. |
| 19 | # |
| 20 | # See also: |
| 21 | # - scripts/docker_env.sh for general Docker prerequisites and other information. |
| 22 | # - compat.sh for notes about invocation of that script. |
| 23 | |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 24 | # Copyright The Mbed TLS Contributors |
Peter Kolbus | 4225b1a | 2019-05-31 06:38:06 -0500 | [diff] [blame] | 25 | # SPDX-License-Identifier: Apache-2.0 |
| 26 | # |
| 27 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 28 | # not use this file except in compliance with the License. |
| 29 | # You may obtain a copy of the License at |
| 30 | # |
| 31 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 32 | # |
| 33 | # Unless required by applicable law or agreed to in writing, software |
| 34 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 35 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 36 | # See the License for the specific language governing permissions and |
| 37 | # limitations under the License. |
Peter Kolbus | 4225b1a | 2019-05-31 06:38:06 -0500 | [diff] [blame] | 38 | |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 39 | source tests/scripts/docker_env.sh |
| 40 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 41 | case "${OPENSSL:-default}" in |
| 42 | "legacy") export OPENSSL="/usr/local/openssl-1.0.1j/bin/openssl";; |
| 43 | "next") export OPENSSL="/usr/local/openssl-1.1.1a/bin/openssl";; |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 44 | *) ;; |
| 45 | esac |
| 46 | |
| 47 | case "${GNUTLS_CLI:-default}" in |
| 48 | "legacy") export GNUTLS_CLI="/usr/local/gnutls-3.3.8/bin/gnutls-cli";; |
Jerry Yu | ab46aa0 | 2021-08-17 10:48:26 +0800 | [diff] [blame] | 49 | "next") export GNUTLS_CLI="/usr/local/gnutls-3.7.2/bin/gnutls-cli";; |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 50 | *) ;; |
| 51 | esac |
| 52 | |
| 53 | case "${GNUTLS_SERV:-default}" in |
| 54 | "legacy") export GNUTLS_SERV="/usr/local/gnutls-3.3.8/bin/gnutls-serv";; |
Jerry Yu | ab46aa0 | 2021-08-17 10:48:26 +0800 | [diff] [blame] | 55 | "next") export GNUTLS_SERV="/usr/local/gnutls-3.7.2/bin/gnutls-serv";; |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 56 | *) ;; |
| 57 | esac |
| 58 | |
| 59 | run_in_docker \ |
| 60 | -e M_CLI \ |
| 61 | -e M_SRV \ |
| 62 | -e GNUTLS_CLI \ |
| 63 | -e GNUTLS_SERV \ |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 64 | -e OPENSSL \ |
Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 65 | -e OSSL_NO_DTLS \ |
| 66 | tests/compat.sh \ |
| 67 | $@ |