From 32e82cb4d01340c9c0bb330fe6ad56f44d67c23e Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sat, 28 Dec 2024 21:38:59 +0000 Subject: [PATCH] Add environment test --- tests/integration/environment/test.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 tests/integration/environment/test.sh diff --git a/tests/integration/environment/test.sh b/tests/integration/environment/test.sh new file mode 100755 index 0000000..c219fc2 --- /dev/null +++ b/tests/integration/environment/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Integration test: compression +# This test aims to verify that the unpacker can handle compressed images + +set -o errexit -o nounset -o pipefail + +trap 'echo "Error on line $LINENO: $BASH_COMMAND"; exit 1' ERR + +docker pull alpine + +__tmpdir=$(mktemp -d) +docker save alpine | APP_LOG_LEVEL=INFO pdm run docker-unpack unpack - "$__tmpdir" + +# Test whether the environment variables are correctly set +apptainer exec --env MYTEST=someteststring "$__tmpdir" env | grep MYTEST + +rm -rf "$__tmpdir" +echo "PASS"