| 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 | # | 
|  | 9 | # Notes for users | 
|  | 10 | # --------------- | 
|  | 11 | # If OPENSSL_CMD, GNUTLS_CLI, or GNUTLS_SERV are specified the path must | 
|  | 12 | # correspond to an executable inside the Docker container. The special | 
|  | 13 | # values "next" (OpenSSL only) and "legacy" are also allowed as shorthand | 
|  | 14 | # for the installations inside the container. | 
|  | 15 | # | 
|  | 16 | # See also: | 
|  | 17 | # - scripts/docker_env.sh for general Docker prerequisites and other information. | 
|  | 18 | # - compat.sh for notes about invocation of that script. | 
|  | 19 |  | 
| Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 20 | # Copyright The Mbed TLS Contributors | 
| Peter Kolbus | 4225b1a | 2019-05-31 06:38:06 -0500 | [diff] [blame] | 21 | # SPDX-License-Identifier: Apache-2.0 | 
|  | 22 | # | 
|  | 23 | # Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 24 | # not use this file except in compliance with the License. | 
|  | 25 | # You may obtain a copy of the License at | 
|  | 26 | # | 
|  | 27 | #  http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 28 | # | 
|  | 29 | # Unless required by applicable law or agreed to in writing, software | 
|  | 30 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 31 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 32 | # See the License for the specific language governing permissions and | 
|  | 33 | # limitations under the License. | 
| Peter Kolbus | 4225b1a | 2019-05-31 06:38:06 -0500 | [diff] [blame] | 34 |  | 
| Peter Kolbus | e4e2d3a | 2018-12-24 09:04:54 -0600 | [diff] [blame] | 35 | source tests/scripts/docker_env.sh | 
|  | 36 |  | 
|  | 37 | case "${OPENSSL_CMD:-default}" in | 
|  | 38 | "legacy")  export OPENSSL_CMD="/usr/local/openssl-1.0.1j/bin/openssl";; | 
|  | 39 | "next")    export OPENSSL_CMD="/usr/local/openssl-1.1.1a/bin/openssl";; | 
|  | 40 | *) ;; | 
|  | 41 | esac | 
|  | 42 |  | 
|  | 43 | case "${GNUTLS_CLI:-default}" in | 
|  | 44 | "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] | 45 | "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] | 46 | *) ;; | 
|  | 47 | esac | 
|  | 48 |  | 
|  | 49 | case "${GNUTLS_SERV:-default}" in | 
|  | 50 | "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] | 51 | "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] | 52 | *) ;; | 
|  | 53 | esac | 
|  | 54 |  | 
|  | 55 | run_in_docker \ | 
|  | 56 | -e M_CLI \ | 
|  | 57 | -e M_SRV \ | 
|  | 58 | -e GNUTLS_CLI \ | 
|  | 59 | -e GNUTLS_SERV \ | 
|  | 60 | -e OPENSSL_CMD \ | 
|  | 61 | -e OSSL_NO_DTLS \ | 
|  | 62 | tests/compat.sh \ | 
|  | 63 | $@ |