Skip to content

Commit

Permalink
Skip some tests under msan
Browse files Browse the repository at this point in the history
These test functions which don't have msan interceptors. This
results in false positives running msan on ubuntu 20.04.
  • Loading branch information
nikic committed May 7, 2021
1 parent 54e2ef0 commit af948ae
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 17 deletions.
7 changes: 4 additions & 3 deletions ext/standard/tests/general_functions/getservbyname_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Michele Orselli (mo@ideato.it)
Simone Gentili (sensorario@gmail.com)
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getservbyname()');
?>
--FILE--
<?php
Expand Down
7 changes: 4 additions & 3 deletions ext/standard/tests/general_functions/getservbyport_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Michele Orselli (mo@ideato.it)
Simone Gentili (sensorario@gmail.com)
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getservbyport()');
?>
--FILE--
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Michele Orselli (mo@ideato.it)
Simone Gentili (sensorario@gmail.com)
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getservbyport()');
?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions ext/standard/tests/network/getmxrr.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip: no Windows support');
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for dn_expand()');
?>
--FILE--
<?php
Expand Down
9 changes: 5 additions & 4 deletions ext/standard/tests/network/getprotobyname_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ getprotobyname function basic test
edgarsandi - <edgar.r.sandi@gmail.com>
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
}
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getprotobyname()');
?>
--FILE--
<?php
var_dump(getprotobyname('tcp'));
var_dump(getprotobyname('tcp'));
?>
--EXPECT--
int(6)
4 changes: 4 additions & 0 deletions ext/standard/tests/network/getprotobyname_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
getprotobyname function errors test
--CREDITS--
edgarsandi - <edgar.r.sandi@gmail.com>
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getprotobyname()');
?>
--FILE--
<?php
// invalid protocol name
Expand Down
9 changes: 5 additions & 4 deletions ext/standard/tests/network/getprotobynumber_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ getprotobynumber function basic test
edgarsandi - <edgar.r.sandi@gmail.com>
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
}
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
}
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getprotobynumber()');
?>
--FILE--
<?php
var_dump(getprotobynumber(6));
var_dump(getprotobynumber(6));
?>
--EXPECT--
string(3) "tcp"
4 changes: 4 additions & 0 deletions ext/standard/tests/network/getprotobynumber_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
getprotobynumber function errors test
--CREDITS--
edgarsandi - <edgar.r.sandi@gmail.com>
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getprotobynumber()');
?>
--FILE--
<?php
// invalid protocol number
Expand Down

0 comments on commit af948ae

Please sign in to comment.