File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ get_fpm_status() {
6161 if test " $VERBOSE " = 1; then printf " Trying to connect to php-fpm via: %s\\ n" " $1 " ; fi ;
6262
6363 # Since I cannot use pipefail I'll just split these in two commands
64- FPM_STATUS=$( cgi-fcgi -bind -connect " $1 " 2> /dev/null)
64+ FPM_STATUS=$( env -i REQUEST_METHOD= " $REQUEST_METHOD " SCRIPT_NAME= " $SCRIPT_NAME " SCRIPT_FILENAME= " $SCRIPT_FILENAME " cgi-fcgi -bind -connect " $1 " 2> /dev/null)
6565 FPM_STATUS=$( echo " $FPM_STATUS " | tail +5)
6666
6767 if test " $VERBOSE " = 1; then printf " php-fpm status output:\\ n%s\\ n" " $FPM_STATUS " ; fi ;
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ def test_fpm_on_socket(host):
3232 host .run ("sed -i /usr/local/etc/php-fpm.d/zz-docker.conf -e '/^listen/ s/.*/listen = 9000/'" )
3333 host .run ("kill -USR2 1" )
3434
35+ # https://github.com/renatomefi/php-fpm-healthcheck/issues/18
36+ @pytest .mark .php_fpm
37+ def test_fpm_on_socket_with_huge_env (host ):
38+ cmd = host .run ("HUGE_ENV=\" $(dd if=/dev/zero bs=8192 count=1 | tr '\\ 000' '\\ 040')\" php-fpm-healthcheck -v" )
39+ assert cmd .rc == 0
40+ assert "Trying to connect to php-fpm via:" in cmd .stdout
41+ assert "status output:" in cmd .stdout
42+ assert "pool:" in cmd .stdout
43+
3544@pytest .mark .alpine
3645def test_exit_when_fpm_is_not_reachable_apk (host ):
3746 cmd = host .run ("FCGI_CONNECT=localhost:9001 php-fpm-healthcheck -v" )
Original file line number Diff line number Diff line change 22
33@pytest .mark .php_fpm
44def test_metric_fail_accepted_conn (host ):
5+ host .run ("kill -USR2 1" ) # reset accepted conn value
56 cmd = host .run ("php-fpm-healthcheck --accepted-conn=0" )
67 assert cmd .rc == 1
78 assert "'accepted conn' value '1' is greater than expected '0'" in cmd .stderr
You can’t perform that action at this time.
0 commit comments