blob: e703c5723aa97c14bcf1976e64a5cec60e1e66c9 [file] [log] [blame]
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -06001#!/bin/bash -eu
2
3# compat-in-docker.sh
4#
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -06005# Purpose
6# -------
7# This runs compat.sh in a Docker container.
8#
Manuel Pégourié-Gonnard59626b62022-12-15 10:08:26 +01009# 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 Kolbuse4e2d3a2018-12-24 09:04:54 -060013# Notes for users
14# ---------------
Manuel Pégourié-Gonnardc5722462022-12-19 11:42:12 +010015# If OPENSSL, GNUTLS_CLI, or GNUTLS_SERV are specified the path must
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060016# 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úti1e148272020-08-07 13:07:28 +020024# Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000025# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Peter Kolbus4225b1a2019-05-31 06:38:06 -050026
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060027source tests/scripts/docker_env.sh
28
Manuel Pégourié-Gonnardc5722462022-12-19 11:42:12 +010029case "${OPENSSL:-default}" in
30 "legacy") export OPENSSL="/usr/local/openssl-1.0.1j/bin/openssl";;
31 "next") export OPENSSL="/usr/local/openssl-1.1.1a/bin/openssl";;
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060032 *) ;;
33esac
34
35case "${GNUTLS_CLI:-default}" in
36 "legacy") export GNUTLS_CLI="/usr/local/gnutls-3.3.8/bin/gnutls-cli";;
Jerry Yuab46aa02021-08-17 10:48:26 +080037 "next") export GNUTLS_CLI="/usr/local/gnutls-3.7.2/bin/gnutls-cli";;
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060038 *) ;;
39esac
40
41case "${GNUTLS_SERV:-default}" in
42 "legacy") export GNUTLS_SERV="/usr/local/gnutls-3.3.8/bin/gnutls-serv";;
Jerry Yuab46aa02021-08-17 10:48:26 +080043 "next") export GNUTLS_SERV="/usr/local/gnutls-3.7.2/bin/gnutls-serv";;
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060044 *) ;;
45esac
46
47run_in_docker \
48 -e M_CLI \
49 -e M_SRV \
50 -e GNUTLS_CLI \
51 -e GNUTLS_SERV \
Manuel Pégourié-Gonnardc5722462022-12-19 11:42:12 +010052 -e OPENSSL \
Peter Kolbuse4e2d3a2018-12-24 09:04:54 -060053 -e OSSL_NO_DTLS \
54 tests/compat.sh \
55 $@