Test::More with suexec

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to create a test with Test::More.

The command I"m issuing in the perl script is /usr/sbin/suexec -V, which will

 -D AP_DOC_ROOT="/home"
 -D AP_GID_MIN=500
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/var/log/httpd/suexec_log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_UID_MIN=500
 -D AP_USERDIR_SUFFIX="Sites/default/htdocs"

But my test is not working:

use warnings;
use strict;

    use Test::More 'no_plan';

    like(`/usr/sbin/suexec -V`, qr/apache/, "suexec is configured");


 I"m getting:

not ok 1 - suexec is configured
#   Failed test 'suexec is configured'
#   at ./x.t line 6.
#                   ''
#     doesn't match '(?-xism:apache)'
# Looks like you failed 1 test of 1.

Does anybody have a clue, I'm thinking it's the way suexec -V outputs is the

Re: Test::More with suexec

Quoted text here. Click to load it

Likely suexec is sending that output to stderr rather than stdout, so
you want `/usr/sbin/suexec 2>&1` instead.


Site Timeline