From 5b9c2781957de62c91b1dfe0d62f6930b9327284 Mon Sep 17 00:00:00 2001 From: Colin Hutchinson Date: Wed, 7 Dec 2022 22:43:00 -0500 Subject: [PATCH] test(linking): add some linking tests (#9) --- Dockerfile | 5 +++++ test.sh | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f84308e..d198e3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ ARG ARCHITECTURE=x86_64 ARG DOCKER_REGISTRY=ghcr.io ARG DOCKER_IMAGE_NAME + # List out all image permutations to trick dependabot FROM --platform=linux/amd64 kong/kong-build-tools:apk-1.8.1 as x86_64-linux-musl FROM --platform=linux/amd64 kong/kong-build-tools:rpm-1.8.1 as x86_64-linux-gnu @@ -16,6 +17,10 @@ FROM $ARCHITECTURE-$OSTYPE as build COPY . /src RUN /src/build.sh && /src/test.sh +# Test scripts left where downstream images can run them +COPY test.sh /test/kong-openssl/test.sh +COPY .env /test/kong-openssl/.env + # Copy the build result to scratch so we can export the result FROM scratch as package diff --git a/test.sh b/test.sh index 0ae81c3..7f5ccd4 100755 --- a/test.sh +++ b/test.sh @@ -11,9 +11,13 @@ export $(grep -v '^#' $SCRIPT_DIR/.env | xargs) function test() { cp -R /tmp/build/* / + mv /tmp/build /tmp/buffer # Check we didn't link dependencies to `/tmp/build/...` + /usr/local/kong/bin/openssl version /usr/local/kong/bin/openssl version | grep -q $OPENSSL_VERSION - ls -la /usr/local/kong/lib/libyaml.so + ldd /usr/local/kong/lib/libyaml.so + + mv /tmp/buffer /tmp/build } test