From: Matteo Beccati Date: Wed, 1 Apr 2020 16:28:34 +0000 (+0200) Subject: Skip fpm tests not designed to be run as root X-Git-Tag: php-7.4.7RC1~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87375fa2bea3e9f0aafaa31055059891d6852cab;p=php Skip fpm tests not designed to be run as root When running as root with TEST_FPM_RUN_AS_ROOT=1 --- diff --git a/sapi/fpm/tests/bug68391-conf-include-order.phpt b/sapi/fpm/tests/bug68391-conf-include-order.phpt index 012a978f29..a357cf8bd3 100644 --- a/sapi/fpm/tests/bug68391-conf-include-order.phpt +++ b/sapi/fpm/tests/bug68391-conf-include-order.phpt @@ -3,6 +3,7 @@ FPM: bug68391 - Configuration inclusion in alphabetical order --SKIPIF-- --FILE-- --FILE-- --FILE-- diff --git a/sapi/fpm/tests/tester.inc b/sapi/fpm/tests/tester.inc index d63e8a7250..da5719b064 100644 --- a/sapi/fpm/tests/tester.inc +++ b/sapi/fpm/tests/tester.inc @@ -278,6 +278,16 @@ class Tester } } + /** + * Skip if running as root. + */ + static public function skipIfRoot() + { + if (getmyuid() == 0) { + die('skip running as root'); + } + } + /** * Skip if posix extension not loaded. */