Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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: 3 additions & 1 deletion src/common-utils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ fi
if [ "${ID}" = "alpine" ]; then
apk add --no-cache bash
fi

if [ "${ID}" = "azurelinux" ]; then
tdnf install -y curl git
fi
Comment thread
ddoyle2017 marked this conversation as resolved.
exec /bin/bash "$(dirname $0)/main.sh" "$@"
exit $?
20 changes: 13 additions & 7 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ install_redhat_packages() {
local package_list=""
local remove_epel="false"
local install_cmd=microdnf
if ! type microdnf > /dev/null 2>&1; then
install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then
install_cmd=yum
fi
fi
if type microdnf > /dev/null 2>&1; then
install_cmd=microdnf
elif type tdnf > /dev/null 2>&1; then
install_cmd=tdnf
elif type dnf > /dev/null 2>&1; then
install_cmd=dnf
elif type yum > /dev/null 2>&1; then
install_cmd=yum
else
echo "Unable to find 'tdnf', 'dnf', or 'yum' package manager. Exiting."
exit 1
fi

if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
package_list="${package_list} \
Expand Down Expand Up @@ -344,7 +350,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
# Get an adjusted ID independent of distro variants
if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
ADJUSTED_ID="debian"
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "azurelinux" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
ADJUSTED_ID="rhel"
VERSION_CODENAME="${ID}${VERSION_ID}"
elif [ "${ID}" = "alpine" ]; then
Expand Down
22 changes: 22 additions & 0 deletions test/common-utils/Azure-linux-CU.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Load Linux distribution info
. /etc/os-release

# Check if the current user is root
check "root user" test "$(whoami)" = "root"

# Check if the Linux distro is Azure Linux
check "azurelinux distro" test "$ID" = "azurelinux"

# Definition specific tests
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
6 changes: 6 additions & 0 deletions test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,11 @@
"features": {
"common-utils": {}
}
},
"Azure-linux-CU": {
"image": "mcr.microsoft.com/dotnet/sdk:8.0-azurelinux3.0",
"features": {
"common-utils": {}
}
}
}