Skip to content

Commit e79f7e3

Browse files
authored
Reorganize the testsuite
Splitting the testsuite in several components makes it easier to manage and comprehend. This was also needed some some tests aren't passing on Alpine Linux, but we still want to run as many of them as we can on this platform.
1 parent c943db5 commit e79f7e3

File tree

483 files changed

+74
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

483 files changed

+74
-61
lines changed

Diff for: .gitlab-ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ testsuite:alpine:
2929
stage: testsuite
3030
script:
3131
- apk update
32-
- apk add php7-dev make gcc musl-dev
32+
- apk add php7-dev php7-cgi php7-simplexml php7-xml make gcc musl-dev
3333
- make compile_debug
34+
- TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test TESTS="tests/cookies_encryption tests/deny_writable tests/disable_function"
35+
- TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test TESTS="tests/dump_request tests/eval_blacklist tests/global_strict"
36+
- TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test TESTS="tests/harden_rand tests/sloppy_comparison"
37+
- TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test TESTS="tests/unserialize tests/xx tests/xxee"
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/tests/config/config_disabled_functions_eval_filename.ini

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/tests/encrypt_cookies4.phpt renamed to src/tests/cookies_encryption/encrypt_cookies4.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ if ($ret == TRUE) {
2323
var_dump($_COOKIE);
2424
?>
2525
--EXPECTF--
26-
Warning: Cookie names must not be empty in %a/tests/encrypt_cookies4.php on line %d
26+
Warning: Cookie names must not be empty in %a/encrypt_cookies4.php on line %d
2727
array(0) {
2828
}
File renamed without changes.

Diff for: src/tests/deny_writable_execution_simulation.phpt renamed to src/tests/deny_writable/deny_writable_execution_simulation.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ unlink("$dir/non_writable_file.txt");
4141
unlink("$dir/writable_file.txt");
4242
?>
4343
--EXPECTF--
44-
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/src/tests/deny_writable_execution_simulation.php). in %a/src/tests/deny_writable_execution_simulation.php on line 2
44+
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/deny_writable_execution_simulation.php). in %a/deny_writable_execution_simulation.php on line 2
4545

46-
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/src/tests/writable_file.txt). in %a/src/tests/deny_writable_execution_simulation.php on line 12
46+
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/writable_file.txt). in %a/deny_writable_execution_simulation.php on line 12
4747

48-
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/src/tests/writable_file.txt). in %a/src/tests/writable_file.txt on line 1
48+
Warning: [snuffleupagus][readonly_exec] Attempted execution of a writable file (%a/writable_file.txt). in %a/writable_file.txt on line 1
4949
Code execution within a writable file.
5050
Code execution within a non-writable file.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sp.disable_function.function("eval").filename_r("^.*/disabled_functions_eval_filename.php$").drop();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sp.disable_function.function("system").drop().cidr("2001:ab9:a::123/64");
2+
sp.disable_function.function("system").drop().cidr("192.168.0.1/16");
3+
sp.disable_function.function("system").drop().cidr("127.0.0.1/8");
4+
sp.disable_function.function("printf").drop().cidr("10.0.0.1/8");
5+
sp.disable_function.function("strpos").drop().cidr("127.0.0.2/4");
6+
sp.disable_function.function("strpos").drop().cidr("::ffff:192.0.2.128/128");
7+
sp.disable_function.function("strpos").drop().cidr("2001:ab9:a::123/64");
8+
sp.disable_function.function("strpos").drop().cidr("2001:0db8:f000:f000:f000:ff00:0042:8329/124");
9+
sp.disable_function.function("printf").drop().cidr("2002:0db8:0000:0000:0000:ff00:0042:8329/24");

Diff for: src/tests/disable_function/config/empty.ini

Whitespace-only changes.

Diff for: src/tests/disabled_function_ensure_client_valid_certs.phpt renamed to src/tests/disable_function/disabled_function_ensure_client_valid_certs.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '0');
1515
echo "1337";
1616
?>
1717
--EXPECTF--
18-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt', because its argument '$option' content (64) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/tests/disabled_function_ensure_client_valid_certs.php on line %d
18+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt', because its argument '$option' content (64) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/disabled_function_ensure_client_valid_certs.php on line %d

Diff for: src/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt renamed to src/tests/disable_function/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ curl_multi_setopt($mch, CURLOPT_SSL_VERIFYPEER, 0);
1414
echo "1337";
1515
?>
1616
--EXPECTF--
17-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_multi_setopt', because its argument '$option' content (64) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.php on line %d
17+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_multi_setopt', because its argument '$option' content (64) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/disabled_function_ensure_client_valid_certs_curl_multi_setopt.php on line %d

Diff for: src/tests/disabled_function_ensure_client_valid_certs_curl_setopt_array.phpt renamed to src/tests/disable_function/disabled_function_ensure_client_valid_certs_curl_setopt_array.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ curl_setopt_array($ch, $options);
1616
echo "1337";
1717
?>
1818
--EXPECTF--
19-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt_array', because its argument '$options' content (0) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/tests/disabled_function_ensure_client_valid_certs_curl_setopt_array.php on line 5
19+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt_array', because its argument '$options' content (0) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYPEER off.' in %s/disabled_function_ensure_client_valid_certs_curl_setopt_array.php on line 5

Diff for: src/tests/disabled_function_ensure_server_valid_certs.phpt renamed to src/tests/disable_function/disabled_function_ensure_server_valid_certs.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '0');
1515
echo "1337";
1616
?>
1717
--EXPECTF--
18-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt', because its argument '$option' content (81) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/tests/disabled_function_ensure_server_valid_certs.php on line %d
18+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt', because its argument '$option' content (81) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/disabled_function_ensure_server_valid_certs.php on line %d

Diff for: src/tests/disabled_function_ensure_server_valid_certs_curl_multi_setopt.phpt renamed to src/tests/disable_function/disabled_function_ensure_server_valid_certs_curl_multi_setopt.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ curl_multi_setopt($mch, CURLOPT_SSL_VERIFYHOST, 0);
1414
echo "1337";
1515
?>
1616
--EXPECTF--
17-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_multi_setopt', because its argument '$option' content (81) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/tests/disabled_function_ensure_server_valid_certs_curl_multi_setopt.php on line %d
17+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_multi_setopt', because its argument '$option' content (81) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/disabled_function_ensure_server_valid_certs_curl_multi_setopt.php on line %d

Diff for: src/tests/disabled_function_ensure_server_valid_certs_curl_setopt_array.phpt renamed to src/tests/disable_function/disabled_function_ensure_server_valid_certs_curl_setopt_array.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ curl_setopt_array($ch, $options);
1616
echo "1337";
1717
?>
1818
--EXPECTF--
19-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt_array', because its argument '$options' content (0) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/tests/disabled_function_ensure_server_valid_certs_curl_setopt_array.php on line 5
19+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt_array', because its argument '$options' content (0) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.' in %s/disabled_function_ensure_server_valid_certs_curl_setopt_array.php on line 5

Diff for: src/tests/disabled_function_super_global_var.phpt renamed to src/tests/disable_function/disabled_function_super_global_var.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ test();
1818
--EXPECTF--
1919
4
2020

21-
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'strlen' in %a/src/tests/disabled_function_super_global_var.php on line 3
21+
Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'strlen' in %a/disabled_function_super_global_var.php on line 3

Diff for: src/tests/disabled_functions_chain_call_user_func_ret.phpt renamed to src/tests/disable_function/disabled_functions_chain_call_user_func_ret.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ not matching_one
2828
one
2929
two
3030

31-
Warning: [snuffleupagus][disabled_function] Aborted execution on return of the function 'two', because the function returned 'matching_two', which matched a rule in %a/tests/disabled_functions_chain_call_user_func_ret.php on line %d
31+
Warning: [snuffleupagus][disabled_function] Aborted execution on return of the function 'two', because the function returned 'matching_two', which matched a rule in %a/disabled_functions_chain_call_user_func_ret.php on line %d
3232
matching_one
3333
one
3434
two

0 commit comments

Comments
 (0)