Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-05-10 18:02:59 +0400
committerJunio C Hamano <gitster@pobox.com>2014-05-12 21:19:23 +0400
commita1a301114e0ba3f60474d857c93d02890d00e65b (patch)
tree1b20b4f25f7c844188586b71cc4faad068ae7fd6 /t/lib-httpd.sh
parenteea591373e139fc8aab89a78ccb0b1512a2bf0de (diff)
t/lib-httpd: require SANITY prereq
Our test httpd setup will not generally run as root, because Apache will want to setuid, and we do not set up the "User" config directive. On some systems, like current Debian unstable, Apache fails to start, and we skip the tests: $ sudo ./t5539-fetch-http-shallow.sh --debug 1..0 # SKIP web server setup failed $ cat trash*t5539*/httpd/error.log [...] (22)Invalid argument: AH00024: Couldn't set permissions on the rewrite-map mutex; check User and Group directives AH00016: Configuration Failed However, on other systems (reportedly Ubuntu 11.04), Apache seems to start, and then bails during our tests with: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive Child 12037 returned a Fatal error... Apache is exiting! This may be related to the pre-fork/threading model in use (note that the second one complains of the child dying). However, it's not even worth investigating; in either case we just want to skip the tests, and we already recommend against running the test suite as root. Let's just explicitly check this condition and skip the tests rather than expecting Apache to do the right thing. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r--t/lib-httpd.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index b43162ea2a..d8918821e6 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -36,6 +36,11 @@ then
test_done
fi
+if ! test_have_prereq SANITY; then
+ test_skip_or_die $GIT_TEST_HTTPD \
+ "Cannot run httpd tests as root"
+fi
+
HTTPD_PARA=""
for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'