From 1b6215897735e2989fd0f81903427085b7991899 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Sat, 30 Jun 2018 21:27:14 +0200 Subject: [PATCH] add test script --- README.md | 10 ++++++++++ testme.sh | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 testme.sh diff --git a/README.md b/README.md index 418d34d..12abfe7 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,13 @@ self-signed CA. - The CA cert will be valid for 3650 days (10 years). - The server cert will be valid for 365 days (1 year). - The x509 certs are ECDSA with prime256v1 curve and SHA256 signatures. + +## Testing + +I have added a simplistic script [testme.sh](testme.sh) that helps to test this +script in the following Linux distributions: + +- Alpine 3.7 +- Ubuntu Bionic +- Debian Stretch +- CentOS 7 diff --git a/testme.sh b/testme.sh new file mode 100755 index 0000000..735815a --- /dev/null +++ b/testme.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +TMPDIR="$(mktemp -d)" +cp -v gencert.sh "${TMPDIR}/" +pushd "${TMPDIR}" + +for DISTRO in alpine:3.7 ubuntu:bionic debian:stretch centos:7; do + printf "\n\n\nTesting the script with ${DISTRO} ...\n\n\n" + rm -vf openssl.cnf private.key public.crt ca.crt ca.key ca.srl + docker run --rm -ti -v ${PWD}:/w -w /w ${DISTRO} sh gencert.sh --cn test.example.com + printf "\n\n\n" +done + +popd +echo "WARNING, I am going to remove ${TMPDIR} entirely in 5 seconds!" +sleep 5 +rm -rf "${TMPDIR}"