mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adds regression test to SecStatusEngine
Just checking the error log while have SecStatusEngine set to On in a first test and Off in a second.
This commit is contained in:
parent
a6d93441c1
commit
d75e443b9b
49
tests/regression/misc/20-status-engine.pl
Normal file
49
tests/regression/misc/20-status-engine.pl
Normal file
@ -0,0 +1,49 @@
|
||||
### Test the SecStatusEngine
|
||||
|
||||
# On
|
||||
{
|
||||
type => "misc",
|
||||
comment => "Setting SecStatusEngine to On",
|
||||
conf => qq(
|
||||
SecRuleEngine On
|
||||
SecStatusEngine On
|
||||
),
|
||||
match_log => {
|
||||
error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
||||
-error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
|
||||
},
|
||||
match_response => {
|
||||
status => qr/^200$/,
|
||||
},
|
||||
request => new HTTP::Request(
|
||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||
[
|
||||
"Content-Type" => "application/x-www-form-urlencoded",
|
||||
],
|
||||
"arg1=val1&arg2=val2",
|
||||
),
|
||||
},
|
||||
# Off
|
||||
{
|
||||
type => "misc",
|
||||
comment => "Setting SecStatusEngine to Off",
|
||||
conf => qq(
|
||||
SecRuleEngine On
|
||||
SecStatusEngine Off
|
||||
),
|
||||
match_log => {
|
||||
-error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
||||
error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
|
||||
},
|
||||
match_response => {
|
||||
status => qr/^200$/,
|
||||
},
|
||||
request => new HTTP::Request(
|
||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||
[
|
||||
"Content-Type" => "application/x-www-form-urlencoded",
|
||||
],
|
||||
"arg1=val1&arg2=val2",
|
||||
),
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user