QA - pcntl - adjust tests set/get priority check env vars and root user

This commit is contained in:
jcm 2022-08-09 16:30:14 +02:00 committed by David Carlier
parent 279a297172
commit 663b037c7b
6 changed files with 30 additions and 0 deletions

View File

@ -2,9 +2,12 @@
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
--EXTENSIONS--
pcntl
posix
--SKIPIF--
<?php
require_once("pcntl_skipif_user_env_rules.inc");
if (!function_exists('pcntl_getpriority')) {
die('skip pcntl_getpriority doesn\'t exist');
}

View File

@ -2,9 +2,12 @@
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
--EXTENSIONS--
pcntl
posix
--SKIPIF--
<?php
require_once("pcntl_skipif_user_env_rules.inc");
if (!function_exists('pcntl_getpriority')) {
die('skip pcntl_getpriority doesn\'t exist');
}

View File

@ -2,9 +2,12 @@
pcntl_setpriority() - Check for errors
--EXTENSIONS--
pcntl
posix
--SKIPIF--
<?php
require_once("pcntl_skipif_user_env_rules.inc");
if (!function_exists('pcntl_setpriority')) {
die('skip pcntl_setpriority doesn\'t exist');
}

View File

@ -2,9 +2,12 @@
pcntl_setpriority() - Check for errors
--EXTENSIONS--
pcntl
posix
--SKIPIF--
<?php
require_once("pcntl_skipif_user_env_rules.inc");
if (!function_exists('pcntl_setpriority')) {
die('skip pcntl_setpriority doesn\'t exist');
}

View File

@ -2,9 +2,12 @@
pcntl_setpriority() - Check for errors
--EXTENSIONS--
pcntl
posix
--SKIPIF--
<?php
require_once("pcntl_skipif_user_env_rules.inc");
if (!function_exists('pcntl_setpriority')) {
die('skip pcntl_setpriority doesn\'t exist');
}

View File

@ -0,0 +1,15 @@
<?php
$envUser = getenv("USER") ?: getenv("USERNAME");
if ($envUser === false) {
die("skip This test is not executed without environment variables USER/USERNAME");
}
if (function_exists("posix_geteuid")) {
if (posix_geteuid() === 0) {
die("skip This test is not executed with root user");
}
}
?>