Skip to content

Commit

Permalink
test(linking): add some linking tests (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchic authored Dec 8, 2022
1 parent 9f20eae commit 5b9c278
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b9c278

Please sign in to comment.