@matheusbsbs / matheus-bagliano / commits / 6448e0ce44
Fork 0

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>

Brian Gernhardt committed Feb 6, 2010 at 00:00 UTC 6448e0ce44295c5168628a658614f2915cc3cd1f
1 file changed +8 -1
t/t9501-gitweb-standalone-http-status.sh
+8 -1
@@ -115,12 +115,19 @@ test_debug 'cat gitweb.output'
115 # ----------------------------------------------------------------------
116 # load checking
117
118 +if test -e /proc/loadavg
119 +then
120 + test_set_prereq PROC_LOADAVG
121 +else
122 + say 'skipping load tests (no /proc/loadavg found)'
123 +fi
124 +
125 # always hit the load limit
126 cat >>gitweb_config.perl <<\EOF
127 our $maxload = 0;
128 EOF
129
123 -test_expect_success 'load checking: load too high (default action)' '
130 +test_expect_success PROC_LOADAVG 'load checking: load too high (default action)' '
131 gitweb_run "p=.git" &&
132 grep "Status: 503 Service Unavailable" gitweb.headers &&
133 grep "503 - The load average on the server is too high" gitweb.body