perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Moyer <>
Subject [patch] Skip tests if run by root user on non-Win32
Date Mon, 19 Apr 2010 20:30:34 GMT
A number of test failures on Apache::Test 1.32 come from tests being
skipped as root user:

This patch should turn those failures into unknowns, which seems to be
the desired behavior when the test suite cannot be run.

Feedback welcome, I've dealt with some of stuff in this area before,
but am not a guru there yet.

Index: Makefile.PL
--- Makefile.PL (revision 935715)
+++ Makefile.PL (working copy)
@@ -223,3 +223,27 @@
+sub MY::test {
+    my $self = shift;
+    # run tests normally if non root user
+    return $self->Apache::TestMM::test(@_) if (($> != 0) # root user
+                            or ($^O eq 'MSWin32'));
# or win32
+    return <<EOF
+\t\@echo Apache::Test tests cannot be run as the root user.
+\t\@echo Apache cannot spawn child processes as 'root', therefore
+\t\@echo we attempt to run the test suite with a non privileged user.
+\t\@echo The problem is that the Apache::Test build directory must be 'rwx',
+\t\@echo so Apache can read and write under that path.
+\t\@echo There are several ways to resolve this issue. One is to move and
+\t\@echo rebuild the distribution to '/tmp/' and repeat the 'make test' phase.
+\t\@echo The other is not to run 'make test' as root, i.e. building
+\t\@echo under your /home/user directory.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message