Apache-Test

 view release on metacpan or  search on metacpan

lib/Apache/TestConfig.pm  view on Meta::CPAN

    }

    $group;
}

sub default_user {
    return if WINFU;

    my $uid = $>;

    my $user = $ENV{APACHE_TEST_USER} || (getpwuid($uid) || "#$uid");

    if ($user eq 'root') {
        my $other = (getpwnam('nobody'))[0];
        if ($other) {
            $user = $other;
        }
        else {
            die "cannot run tests as User root";
            #XXX: prompt for another username
        }

lib/Apache/TestRun.pm  view on Meta::CPAN


    Apache::TestConfig->new($self->{conf_opts});
}

sub set_ulimit_via_sh {
    return if Apache::TestConfig::WINFU;
    return if $ENV{APACHE_TEST_ULIMIT_SET};

    # only root can allow unlimited core dumps on Solaris (8 && 9?)
    if (Apache::TestConfig::SOLARIS) {
        my $user = getpwuid($>) || '';
        if ($user ne 'root') {
            warning "Skipping 'set unlimited ulimit for coredumps', " .
                "since we are running as a non-root user on Solaris";
            return;
        }
    }

    my $binsh = '/bin/sh';
    return unless -e $binsh;
    $ENV{APACHE_TEST_ULIMIT_SET} = 1;

lib/Apache/TestRun.pm  view on Meta::CPAN

    }, $vars->{top_dir});
}

# catch any attempts to ./t/TEST the tests as root user

sub check_runtime_user {
    my $self = shift;

    return if Apache::TestConfig::WINFU;

    my $user = getpwuid($>) || '';

    if ($user eq 'root') {
        error "Apache cannot spawn child processes as root, therefore the test suite must be run as a non-privileged user.";
        exit_perl(1);
    }

    return 1;
}

sub run_request {



( run in 0.685 second using v1.01-cache-2.11-cpan-8d75d55dd25 )