Skip fpm tests not designed to be run as root

When running as root with TEST_FPM_RUN_AS_ROOT=1
This commit is contained in:
Matteo Beccati 2020-04-01 18:28:34 +02:00
parent af337ae47e
commit 87375fa2be
4 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@ FPM: bug68391 - Configuration inclusion in alphabetical order
--SKIPIF--
<?php
include "skipif.inc";
FPM\Tester::skipIfRoot();
?>
--FILE--
<?php

View File

@ -3,6 +3,7 @@ FPM: Process user setting ignored when FPM is not running as root
--SKIPIF--
<?php
include "skipif.inc";
FPM\Tester::skipIfRoot();
?>
--FILE--
<?php

View File

@ -3,6 +3,7 @@ FPM: UNIX socket owner and group settings can be numeric
--SKIPIF--
<?php
include "skipif.inc";
FPM\Tester::skipIfRoot();
FPM\Tester::skipIfPosixNotLoaded();
?>
--FILE--

View File

@ -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.
*/