Skip to content

Commit c4a20af

Browse files
committed
Skip failing pcntl tests in Docker with insufficient caps
1 parent ab2dc66 commit c4a20af

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

ext/curl/tests/bug77535.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Bug #77535 (Invalid callback, h2 server push)
33
--EXTENSIONS--
44
curl
5-
--XLEAK--
5+
--XFAIL--
66
--SKIPIF--
77
<?php
88
include 'skipif-nocaddy.inc';

ext/curl/tests/curl_pushfunction_trampoline.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test trampoline for curl option CURLMOPT_PUSHFUNCTION
33
--EXTENSIONS--
44
curl
5-
--XLEAK--
5+
--XFAIL--
66
--SKIPIF--
77
<?php
88
include 'skipif-nocaddy.inc';

ext/pcntl/tests/pcntl_setns_basic.phpt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ posix
77
<?php
88
if (!function_exists("pcntl_setns")) die("skip pcntl_setns is not available");
99
if (getenv('SKIP_ASAN')) die('skip Timeouts under ASAN');
10+
11+
$pid = pcntl_fork();
12+
if ($pid == -1) die("skip pcntl_fork failed");
13+
if ($pid != 0) {
14+
if (@pcntl_setns(getmypid(), CLONE_NEWPID) === false && pcntl_get_last_error() == PCNTL_EPERM) {
15+
die("skip Insufficient privileges to use pcntl_setns()");
16+
}
17+
}
1018
?>
1119
--FILE--
1220
<?php

ext/pcntl/tests/pcntl_setns_newpid.phpt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ posix
66
--SKIPIF--
77
<?php
88
if (!function_exists("pcntl_setns")) die("skip pcntl_setns is not available");
9-
if (posix_getuid() !== 0) die('skip Test needs root user');
109
if (getenv('SKIP_ASAN')) die('skip Timeouts under ASAN');
10+
11+
$pid = pcntl_fork();
12+
if ($pid == -1) die("skip pcntl_fork failed");
13+
if ($pid != 0) {
14+
if (@pcntl_setns(getmypid(), CLONE_NEWPID) === false && pcntl_get_last_error() == PCNTL_EPERM) {
15+
die("skip Insufficient privileges to use pcntl_setns()");
16+
}
17+
}
1118
?>
1219
--FILE--
1320
<?php

ext/pdo_odbc/tests/long_columns.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ PDO ODBC "long" columns
44
pdo_odbc
55
--SKIPIF--
66
<?php
7-
// make sure there is an ODBC driver and a DSN, or the test will fail
8-
include 'ext/pdo/tests/pdo_test.inc';
9-
$config = PDOTest::get_config('ext/pdo_odbc/tests/common.phpt');
10-
if (!isset($config['ENV']['PDOTEST_DSN']) || $config['ENV']['PDOTEST_DSN']===false) print 'skip';
7+
require 'ext/pdo/tests/pdo_test.inc';
8+
PDOTest::skip();
119
?>
1210
--FILE--
1311
<?php

0 commit comments

Comments
 (0)