forked from devcontainers/features
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxdg_runtime_dir_socket.sh
More file actions
26 lines (18 loc) · 852 Bytes
/
xdg_runtime_dir_socket.sh
File metadata and controls
26 lines (18 loc) · 852 Bytes
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
#!/bin/bash
set -e
source dev-container-features-test-lib
echo "=== XDG Runtime Directory Socket Test ==="
# Test XDG_RUNTIME_DIR style socket configuration
EXPECTED_SOCKET="/var/run/user-docker.sock"
# Check if the socket exists and is accessible
check "xdg-socket-exists" test -S "$EXPECTED_SOCKET"
check "xdg-socket-readable" test -r "$EXPECTED_SOCKET"
# Verify Docker functionality using the XDG-style socket
export DOCKER_HOST="unix://$EXPECTED_SOCKET"
check "docker-functional-xdg" docker ps >/dev/null
# Test that this works for rootless-style configurations
check "docker-version-xdg" docker version --format '{{.Client.Version}}' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+' >/dev/null
# Verify the socket path matches what a customer would configure
echo "XDG-style socket path: $EXPECTED_SOCKET"
echo "Docker host: $DOCKER_HOST"
reportResults