diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index a929f534a..07aa0f60d 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -43,6 +43,13 @@ } } }, + "sid": { + "image": "debian:sid", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, "centos-7": { "image": "centos:7", "remoteUser": "devcontainer", diff --git a/test/common-utils/sid.sh b/test/common-utils/sid.sh new file mode 100644 index 000000000..9432eb37b --- /dev/null +++ b/test/common-utils/sid.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +FAILED=() +echoStderr() +{ + echo "$@" 1>&2 +} + +endsWith() { + [[ $1 = *$2 ]] && return 0 || return 1 +} + +checkOSPackages() { + LABEL=$1 + shift + echo -e "\n🧪 Testing $LABEL" + if dpkg-query --show -f='${Package}: ${Version}\n' "$@"; then + echo "✅ Passed!" + return 0 + else + echoStderr "❌ $LABEL check failed." + FAILED+=("$LABEL") + return 1 + fi +} + +checkCommon() +{ + PACKAGE_LIST="libssl3t64" + + checkOSPackages "Confirm that libssl3t64 is installed" ${PACKAGE_LIST} +} + +# Check that libssl3t64 is installed +checkCommon + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "release" endsWith "${PRETTY_NAME}" "sid" + +# Report result +reportResults \ No newline at end of file