@@ -27,6 +27,7 @@ log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
2727# Parse arguments
2828KEEP_RUNNING=false
2929REBUILD=false
30+ SYSTEMD_MODE=false
3031while [[ $# -gt 0 ]]; do
3132 case $1 in
3233 --keep|-k)
@@ -37,12 +38,17 @@ while [[ $# -gt 0 ]]; do
3738 REBUILD=true
3839 shift
3940 ;;
41+ --systemd|-s)
42+ SYSTEMD_MODE=true
43+ shift
44+ ;;
4045 --help|-h)
4146 echo " Usage: $0 [OPTIONS]"
4247 echo " "
4348 echo " Options:"
4449 echo " --keep, -k Keep containers running after tests"
4550 echo " --rebuild, -r Force rebuild of containers"
51+ echo " --systemd, -s Run systemd socket activation test"
4652 echo " --help, -h Show this help message"
4753 exit 0
4854 ;;
5561
5662cd " ${PROJECT_DIR} "
5763
64+ COMPOSE_FILES=(-f compose.yaml)
65+ if [[ " ${SYSTEMD_MODE} " == " true" ]]; then
66+ COMPOSE_FILES+=(-f compose.systemd.yaml)
67+ fi
68+
5869# Step 1: Generate certificates if needed
5970if [[ ! -f " ${CERT_DIR} /pebble-ca.pem" ]]; then
6071 log_info " Generating test certificates..."
@@ -70,7 +81,7 @@ if [[ "${REBUILD}" == "true" ]]; then
7081 BUILD_ARGS=" --build"
7182fi
7283
73- podman compose up -d ${BUILD_ARGS}
84+ podman compose " ${COMPOSE_FILES[@]} " up -d ${BUILD_ARGS}
7485
7586# Step 3: Wait for services to be ready
7687log_info " Waiting for services to be ready..."
@@ -138,6 +149,14 @@ run_test "Envoy has LDS listeners" \
138149run_test " Envoy has CDS clusters" \
139150 ' curl -sf http://localhost:9901/config_dump | grep -q "xds_cluster"'
140151
152+ if [[ " ${SYSTEMD_MODE} " == " true" ]]; then
153+ run_test " Systemd socket active" \
154+ ' podman exec xds-server systemctl is-active envoy-acme-xds.socket | grep -q "active"'
155+
156+ run_test " Systemd service active" \
157+ ' podman exec xds-server systemctl is-active envoy-acme-xds.service | grep -q "active"'
158+ fi
159+
141160# Test: HTTP port is responding
142161run_test " Envoy HTTP port" \
143162 ' curl -sf -o /dev/null -w "%{http_code}" http://localhost:8080/ 2>/dev/null | grep -qE "^(200|301|302|308)$"'
@@ -163,7 +182,7 @@ if [[ "${KEEP_RUNNING}" == "true" ]]; then
163182 echo " - Pebble ACME: https://localhost:14000/dir"
164183else
165184 log_info " Stopping containers..."
166- podman compose down
185+ podman compose " ${COMPOSE_FILES[@]} " down
167186fi
168187
169188# Exit with appropriate code
0 commit comments