Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
path: |
/tmp/fpm.stdout
/tmp/fpm.stderr
/tmp/php-fpm.log
if-no-files-found: ignore

release:
Expand Down
10 changes: 6 additions & 4 deletions tests/e2e/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ fcgi_call() {
# mid-call due to a non-zero cgi-fcgi exit, so the temp dir is always removed.
trap 'rm -rf "$script_dir"' RETURN
echo "<?php $php_body" > "$script_dir/run.php"
SCRIPT_FILENAME="$script_dir/run.php" \
SCRIPT_NAME=/run.php \
REQUEST_METHOD=GET \
QUERY_STRING="" \
env -i \
PATH="$PATH" \
SCRIPT_FILENAME="$script_dir/run.php" \
SCRIPT_NAME=/run.php \
REQUEST_METHOD=GET \
QUERY_STRING="" \
cgi-fcgi -bind -connect "$connect"
}

Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/cases/10_fcgi_tcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -euo pipefail
source "$(dirname "$0")/../_lib.sh"

step "FastCGI roundtrip over TCP $FPM_TCP_ADDR"
RESPONSE=$(fcgi_call "$FPM_TCP_ADDR" 'echo "FCGI_OK\n";' 2>&1)
rc=0
RESPONSE=$(fcgi_call "$FPM_TCP_ADDR" 'echo "FCGI_OK\n";' 2>&1) || rc=$?
echo "$RESPONSE"
[[ "$rc" -eq 0 ]] || fail "cgi-fcgi exited with $rc on $FPM_TCP_ADDR"
echo "$RESPONSE" | grep -q "FCGI_OK" || fail "TCP roundtrip did not return FCGI_OK"
ok "TCP FastCGI executed PHP"
4 changes: 3 additions & 1 deletion tests/e2e/cases/11_fcgi_sock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -euo pipefail
source "$(dirname "$0")/../_lib.sh"

step "FastCGI roundtrip over $FPM_SOCK"
RESPONSE=$(fcgi_call "$FPM_SOCK" 'echo "FCGI_OK\n";' 2>&1)
rc=0
RESPONSE=$(fcgi_call "$FPM_SOCK" 'echo "FCGI_OK\n";' 2>&1) || rc=$?
echo "$RESPONSE"
[[ "$rc" -eq 0 ]] || fail "cgi-fcgi exited with $rc on $FPM_SOCK"
echo "$RESPONSE" | grep -q "FCGI_OK" || fail "unix socket roundtrip failed"
ok "Unix socket FastCGI executed PHP"
4 changes: 3 additions & 1 deletion tests/e2e/cases/12_php_ini_effective.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -euo pipefail
source "$(dirname "$0")/../_lib.sh"

step "-c php.ini effective inside worker (memory_limit, expose_php)"
rc=0
RESPONSE=$(fcgi_call "$FPM_TCP_ADDR" \
'echo "MEM=" . ini_get("memory_limit") . "\n"; echo "EXPOSE=" . (ini_get("expose_php") ? "On" : "Off") . "\n";' \
2>&1)
2>&1) || rc=$?
echo "$RESPONSE"
[[ "$rc" -eq 0 ]] || fail "cgi-fcgi exited with $rc on $FPM_TCP_ADDR"
echo "$RESPONSE" | grep -q "MEM=256M" \
|| fail "memory_limit not 256M inside worker — -c flag not effective"
echo "$RESPONSE" | grep -q "EXPOSE=Off" \
Expand Down