t9501: Skip testing load if we can't detect it
Currently gitweb only knows how to check for load using /proc/loadavg, which isn't available on all systems. We shouldn't fail the test just because we don't know how to check the system load. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
71f1a216e7
commit
6448e0ce44
@ -115,12 +115,19 @@ test_debug 'cat gitweb.output'
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# load checking
|
# load checking
|
||||||
|
|
||||||
|
if test -e /proc/loadavg
|
||||||
|
then
|
||||||
|
test_set_prereq PROC_LOADAVG
|
||||||
|
else
|
||||||
|
say 'skipping load tests (no /proc/loadavg found)'
|
||||||
|
fi
|
||||||
|
|
||||||
# always hit the load limit
|
# always hit the load limit
|
||||||
cat >>gitweb_config.perl <<\EOF
|
cat >>gitweb_config.perl <<\EOF
|
||||||
our $maxload = 0;
|
our $maxload = 0;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_success 'load checking: load too high (default action)' '
|
test_expect_success PROC_LOADAVG 'load checking: load too high (default action)' '
|
||||||
gitweb_run "p=.git" &&
|
gitweb_run "p=.git" &&
|
||||||
grep "Status: 503 Service Unavailable" gitweb.headers &&
|
grep "Status: 503 Service Unavailable" gitweb.headers &&
|
||||||
grep "503 - The load average on the server is too high" gitweb.body
|
grep "503 - The load average on the server is too high" gitweb.body
|
||||||
|
Reference in New Issue
Block a user