Tests: fixes regression/rule/20-exceptions.t

Tests were failing because they were writing wrong/outdated.
This commit is contained in:
Felipe Zimmerle
2014-01-01 11:21:37 -08:00
parent 0c99063aae
commit ddb4fceb63

View File

@@ -8,11 +8,11 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:101010"
SecRuleRemoveById 1 SecRuleRemoveById 101010
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/101010/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ], debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
@@ -31,13 +31,13 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:101010"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:2" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:202020"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:3" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:303030"
SecRuleRemoveById 1 2 3 SecRuleRemoveById 101010 202020 303030
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/101010|202020|303030/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ], debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
@@ -56,13 +56,13 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:101010"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:2" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:202020"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:3" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:303030"
SecRuleRemoveById 1-3 SecRuleRemoveById 101010-303030
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/101010|202020|303030/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ], debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
@@ -81,14 +81,14 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:101010"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:2" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:202020"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:3" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:303030"
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:4" SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:404040"
SecRuleRemoveById 1 2-4 SecRuleRemoveById 101010 202020-404040
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/101010|202020|303030|404040/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ], debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
@@ -109,11 +109,11 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1,msg:'testing rule',id:500001" SecRule REQUEST_URI "test" "phase:1,deny,status:500,msg:'testing rule',id:500001"
SecRuleRemoveByMsg "testing rule" SecRuleRemoveByMsg "testing rule"
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/500001/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ], debug => [ qr/Starting phase REQUEST_HEADERS\..*This phase consists of 0 rule.*Starting phase RESPONSE_HEADERS\./s, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
@@ -134,13 +134,13 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1,msg:'testing rule',id:500002" SecRule REQUEST_URI "test" "phase:1,deny,status:500,msg:'testing rule',id:500002"
SecRuleUpdateActionById 1 "pass,nolog" SecRuleUpdateActionById 500002 "pass,nolog"
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/500002/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/id:1,.*,pass,nolog/, 1 ], debug => [ qr/id:500002,pass,nolog/, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
}, },
match_response => { match_response => {
@@ -157,14 +157,14 @@
SecRuleEngine On SecRuleEngine On
SecDebugLog $ENV{DEBUG_LOG} SecDebugLog $ENV{DEBUG_LOG}
SecDebugLogLevel 9 SecDebugLogLevel 9
SecRule REQUEST_URI "test" "phase:1,deny,status:500,id:1,msg:'testing rule',chain,id:500003" SecRule REQUEST_URI "test" "phase:1,deny,status:500,msg:'testing rule',chain,id:500003"
SecRule ARGS "bar,id:500004" SecRule ARGS "bar"
SecRuleUpdateActionById 1 "pass,nolog" SecRuleUpdateActionById 500003 "pass,nolog"
), ),
match_log => { match_log => {
-error => [ qr/ModSecurity: /, 1 ], -error => [ qr/500003/, 1 ],
-audit => [ qr/./, 1 ], -audit => [ qr/./, 1 ],
debug => [ qr/id:1,.*,pass,nolog/, 1 ], debug => [ qr/id:500003,pass,nolog/, 1 ],
-debug => [ qr/Access denied/, 1 ], -debug => [ qr/Access denied/, 1 ],
}, },
match_response => { match_response => {