diff options
author | Hans Nilsson <[email protected]> | 2017-12-08 18:51:56 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-01-08 10:51:30 +0100 |
commit | 404424917140bd50896dd9aa5cc7288ea2d7abce (patch) | |
tree | 6fc1687feaa7114d3cda135130103e4ef978d490 /lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image | |
parent | 19b7ccfe076d88a96b62f3222f38be31bb087df2 (diff) | |
download | otp-404424917140bd50896dd9aa5cc7288ea2d7abce.tar.gz otp-404424917140bd50896dd9aa5cc7288ea2d7abce.tar.bz2 otp-404424917140bd50896dd9aa5cc7288ea2d7abce.zip |
ssh: A compatibility testing suite using dockers
This suite tests compatibility with different combinations of OpenSSH and OpenSSL. The peer SSH is running in a docker container.
Diffstat (limited to 'lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image')
-rwxr-xr-x | lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image new file mode 100755 index 0000000000..66f8358b8a --- /dev/null +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image @@ -0,0 +1,61 @@ +#!/bin/sh + +# ./create-image openssl 1.0.2m + +case "$1" in + "openssl") + FAM=openssl + VER=$2 + PFX=https://www.openssl.org/source/openssl- + SFX=.tar.gz + TMP=tmp.tar.gz + ;; + "libressl") + FAM=libressl + VER=$2 + PFX=https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl- + SFX=.tar.gz + TMP=tmp.tar.gz + ;; + *) + echo No lib type + exit + ;; +esac + +# This way of fetching the tar-file separate from the docker commands makes +# http-proxy handling way easier. The wget command handles the $https_proxy +# variable while the docker command must have /etc/docker/something changed +# and the docker server restarted. That is not possible without root access. + +# Make a Dockerfile. This method simplifies env variable handling considerably: +cat - > TempDockerFile <<EOF + + FROM ubuntubuildbase + + LABEL version=$FAM-$VER + + WORKDIR /buildroot + + COPY ${TMP} . + RUN tar xf ${TMP} + + WORKDIR ${FAM}-${VER} + + RUN ./config --prefix=/buildroot/ssl + + RUN make + RUN make install + + RUN echo Built ${FAM}-${VER} +EOF + +# Fetch the tar file. This could be done in an "ADD ..." in the Dockerfile, +# but then we hit the proxy problem... +wget -O $TMP $PFX$VER$SFX + +# Build the image: +docker build -t ssh_compat_suite-$FAM:$VER -f ./TempDockerFile . + +# Cleaning +rm -fr ./TempDockerFile $TMP |