forked from devcontainers/features
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·43 lines (36 loc) · 1.06 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·43 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
echoStderr()
{
echo "$@" 1>&2
}
checkOSPackage() {
LABEL=$1
PACKAGE_NAME=$2
echo -e "\n🧪 Testing $LABEL"
# Check if the package exists and retrieve its exact version
if [ "$(dpkg-query -W -f='${Status}' "$PACKAGE_NAME" 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then
echo "✅ Package '$PACKAGE_NAME' is installed."
exit 0
else
echo "❌ Package '$PACKAGE_NAME' is not installed."
exit 1
fi
}
check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh"
check "log-exists" bash -c "ls /tmp/container-init.log"
check "fluxbox-exists" bash -c "ls -la ~/.fluxbox"
. /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
if [ "${VERSION_CODENAME}" = "noble" ]; then
checkOSPackage "if libasound2-dev exists !" "libasound2-dev"
else
checkOSPackage "if libasound2 exists !" "libasound2"
fi
else
checkOSPackage "if libasound2 exists !" "libasound2"
fi
# Report result
reportResults