php-src/sapi/fpm/tests/skipif.inc
Sara Golemon d8d1c78ed0 Skip FPM tests when running as root (unless requested)
FPM must be configured as a user.
Normally it defaults to the current user,
but if that's root it'll fail to startup
unless the --run-as-root option is provided.

Extend that logic into the test runner so that
we don't fail for stupid reasons.

If you're running `make test` as root and you want
FPM tests to run anyway, set TEST_FPM_RUN_AS_ROOT=1
in your environment.
2017-05-24 13:58:18 -07:00

17 lines
268 B
PHP

<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die ("skip not for Windows");
}
if (!getmyuid() && !getenv('TEST_FPM_RUN_AS_ROOT')) {
die('Refusing to run as root');
}
include dirname(__FILE__)."/include.inc";
if (!get_fpm_path()) {
die("skip FPM not found");
}
?>