diff options
| author | Ben Fuhrmannek | 2014-10-06 17:36:23 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2014-10-06 17:36:23 +0200 |
| commit | ff4edc6ecf463211c6527879d6b23f991fd5b73b (patch) | |
| tree | d926fa666c778b5b422b5d7aaa18f516fa6f2abb /tests/logging | |
| parent | def06bc8331efe49ad3a3768da7800f60459c390 (diff) | |
restructured error output in unittests. (issues #52 + #54)
Diffstat (limited to 'tests/logging')
| -rw-r--r-- | tests/logging/use_x_forwarded_for_off.phpt | 12 | ||||
| -rw-r--r-- | tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt | 12 | ||||
| -rw-r--r-- | tests/logging/use_x_forwarded_for_on.phpt | 12 | ||||
| -rw-r--r-- | tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt | 12 |
4 files changed, 32 insertions, 16 deletions
diff --git a/tests/logging/use_x_forwarded_for_off.phpt b/tests/logging/use_x_forwarded_for_off.phpt index 6b31d53..2820523 100644 --- a/tests/logging/use_x_forwarded_for_off.phpt +++ b/tests/logging/use_x_forwarded_for_off.phpt | |||
| @@ -3,12 +3,16 @@ Testing: suhosin.log.use-x-forwarded-for=Off | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php include "../skipifnotcli.inc"; ?> | 4 | <?php include "../skipifnotcli.inc"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | suhosin.log.syslog=0 | ||
| 6 | suhosin.log.sapi=0 | 7 | suhosin.log.sapi=0 |
| 7 | suhosin.log.stdout=255 | ||
| 8 | suhosin.log.script=0 | 8 | suhosin.log.script=0 |
| 9 | suhosin.log.syslog=0 | 9 | suhosin.log.file=255 |
| 10 | suhosin.log.file.time=0 | ||
| 11 | suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | ||
| 12 | auto_append_file={PWD}/suhosintest.$$.log.tmp | ||
| 10 | suhosin.executor.func.blacklist=max | 13 | suhosin.executor.func.blacklist=max |
| 11 | suhosin.log.use-x-forwarded-for=Off | 14 | suhosin.log.use-x-forwarded-for=Off |
| 15 | suhosin.simulation=1 | ||
| 12 | --ENV-- | 16 | --ENV-- |
| 13 | return <<<END | 17 | return <<<END |
| 14 | REMOTE_ADDR=101.102.103.104 | 18 | REMOTE_ADDR=101.102.103.104 |
| @@ -19,5 +23,5 @@ END; | |||
| 19 | max(1,2); | 23 | max(1,2); |
| 20 | ?> | 24 | ?> |
| 21 | --EXPECTF-- | 25 | --EXPECTF-- |
| 22 | Warning: max() has been disabled for security reasons in %s on line 2 | 26 | Warning: SIMULATION - max() has been disabled for security reasons in %s on line 2 |
| 23 | ALERT - function within blacklist called: max() (attacker '101.102.103.104', file '%s', line 2) \ No newline at end of file | 27 | ALERT-SIMULATION - function within blacklist called: max() (attacker '101.102.103.104', file '%s', line 2) \ No newline at end of file |
diff --git a/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt b/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt index bd4c72b..1a30e81 100644 --- a/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt +++ b/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt | |||
| @@ -3,16 +3,20 @@ Testing: suhosin.log.use-x-forwarded-for=Off (without REMOTE_ADDR set) | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php include "../skipifnotcli.inc"; ?> | 4 | <?php include "../skipifnotcli.inc"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | suhosin.log.syslog=0 | ||
| 6 | suhosin.log.sapi=0 | 7 | suhosin.log.sapi=0 |
| 7 | suhosin.log.stdout=255 | ||
| 8 | suhosin.log.script=0 | 8 | suhosin.log.script=0 |
| 9 | suhosin.log.syslog=0 | 9 | suhosin.log.file=255 |
| 10 | suhosin.log.file.time=0 | ||
| 11 | suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | ||
| 12 | auto_append_file={PWD}/suhosintest.$$.log.tmp | ||
| 10 | suhosin.executor.func.blacklist=max | 13 | suhosin.executor.func.blacklist=max |
| 11 | suhosin.log.use-x-forwarded-for=Off | 14 | suhosin.log.use-x-forwarded-for=Off |
| 15 | suhosin.simulation=1 | ||
| 12 | --FILE-- | 16 | --FILE-- |
| 13 | <?php | 17 | <?php |
| 14 | max(1,2); | 18 | max(1,2); |
| 15 | ?> | 19 | ?> |
| 16 | --EXPECTF-- | 20 | --EXPECTF-- |
| 17 | Warning: max() has been disabled for security reasons in %s on line 2 | 21 | Warning: SIMULATION - max() has been disabled for security reasons in %s on line 2 |
| 18 | ALERT - function within blacklist called: max() (attacker 'REMOTE_ADDR not set', file '%s', line 2) \ No newline at end of file | 22 | ALERT-SIMULATION - function within blacklist called: max() (attacker 'REMOTE_ADDR not set', file '%s', line 2) \ No newline at end of file |
diff --git a/tests/logging/use_x_forwarded_for_on.phpt b/tests/logging/use_x_forwarded_for_on.phpt index 5f37ca9..e476ba7 100644 --- a/tests/logging/use_x_forwarded_for_on.phpt +++ b/tests/logging/use_x_forwarded_for_on.phpt | |||
| @@ -3,12 +3,16 @@ Testing: suhosin.log.use-x-forwarded-for=On | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php include "../skipifnotcli.inc"; ?> | 4 | <?php include "../skipifnotcli.inc"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | suhosin.log.syslog=0 | ||
| 6 | suhosin.log.sapi=0 | 7 | suhosin.log.sapi=0 |
| 7 | suhosin.log.stdout=255 | ||
| 8 | suhosin.log.script=0 | 8 | suhosin.log.script=0 |
| 9 | suhosin.log.syslog=0 | 9 | suhosin.log.file=255 |
| 10 | suhosin.log.file.time=0 | ||
| 11 | suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | ||
| 12 | auto_append_file={PWD}/suhosintest.$$.log.tmp | ||
| 10 | suhosin.executor.func.blacklist=max | 13 | suhosin.executor.func.blacklist=max |
| 11 | suhosin.log.use-x-forwarded-for=On | 14 | suhosin.log.use-x-forwarded-for=On |
| 15 | suhosin.simulation=1 | ||
| 12 | --ENV-- | 16 | --ENV-- |
| 13 | return <<<END | 17 | return <<<END |
| 14 | REMOTE_ADDR=101.102.103.104 | 18 | REMOTE_ADDR=101.102.103.104 |
| @@ -19,5 +23,5 @@ END; | |||
| 19 | max(1,2); | 23 | max(1,2); |
| 20 | ?> | 24 | ?> |
| 21 | --EXPECTF-- | 25 | --EXPECTF-- |
| 22 | Warning: max() has been disabled for security reasons in %s on line 2 | 26 | Warning: SIMULATION - max() has been disabled for security reasons in %s on line 2 |
| 23 | ALERT - function within blacklist called: max() (attacker '1.2.3.4', file '%s', line 2) \ No newline at end of file | 27 | ALERT-SIMULATION - function within blacklist called: max() (attacker '1.2.3.4', file '%s', line 2) \ No newline at end of file |
diff --git a/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt b/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt index aea6e06..b3e26de 100644 --- a/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt +++ b/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt | |||
| @@ -3,16 +3,20 @@ Testing: suhosin.log.use-x-forwarded-for=On (without X-Forwarded-For set) | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php include "../skipifnotcli.inc"; ?> | 4 | <?php include "../skipifnotcli.inc"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | suhosin.log.syslog=0 | ||
| 6 | suhosin.log.sapi=0 | 7 | suhosin.log.sapi=0 |
| 7 | suhosin.log.stdout=255 | ||
| 8 | suhosin.log.script=0 | 8 | suhosin.log.script=0 |
| 9 | suhosin.log.syslog=0 | 9 | suhosin.log.file=255 |
| 10 | suhosin.log.file.time=0 | ||
| 11 | suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | ||
| 12 | auto_append_file={PWD}/suhosintest.$$.log.tmp | ||
| 10 | suhosin.executor.func.blacklist=max | 13 | suhosin.executor.func.blacklist=max |
| 11 | suhosin.log.use-x-forwarded-for=On | 14 | suhosin.log.use-x-forwarded-for=On |
| 15 | suhosin.simulation=1 | ||
| 12 | --FILE-- | 16 | --FILE-- |
| 13 | <?php | 17 | <?php |
| 14 | max(1,2); | 18 | max(1,2); |
| 15 | ?> | 19 | ?> |
| 16 | --EXPECTF-- | 20 | --EXPECTF-- |
| 17 | Warning: max() has been disabled for security reasons in %s on line 2 | 21 | Warning: SIMULATION - max() has been disabled for security reasons in %s on line 2 |
| 18 | ALERT - function within blacklist called: max() (attacker 'X-FORWARDED-FOR not set', file '%s', line 2) \ No newline at end of file | 22 | ALERT-SIMULATION - function within blacklist called: max() (attacker 'X-FORWARDED-FOR not set', file '%s', line 2) \ No newline at end of file |
