Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[common-utils] Fixes issue installing libssl3 on debian unstable #1160

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "common-utils",
"version": "2.5.2",
"version": "2.5.3",
"name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
Expand Down Expand Up @@ -66,4 +66,4 @@
"description": "Add packages from non-free Debian repository? (Debian only)"
}
}
}
}
9 changes: 7 additions & 2 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ install_debian_packages() {
fi

# Include libssl3 if available
if [[ ! -z $(apt-cache --names-only search ^libssl3$) ]]; then
package_list="${package_list} libssl3"
if [[ ! -z $(apt-cache --names-only search ^libssl3) ]]; then
# Test if the t64 package is available, prefer that to the non-64 bit package
if [[ ! -z $(apt-cache --names-only search ^libssl3t64$) ]]; then
package_list="${package_list} libssl3t64"
elif [[ ! -z $(apt-cache --names-only search ^libssl3$) ]]; then
package_list="${package_list} libssl3"
fi
fi

# Include appropriate version of libssl1.0.x if available
Expand Down
7 changes: 7 additions & 0 deletions test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
}
}
},
"sid": {
"image": "debian:sid",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"centos-7": {
"image": "centos:7",
"remoteUser": "devcontainer",
Expand Down
48 changes: 48 additions & 0 deletions test/common-utils/sid.sh
Original file line number Diff line number Diff line change
@@ -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