Fix some improperly formatted test cases

This commit is contained in:
Felipe Zimmerle 2016-06-14 14:47:26 -03:00
parent 8cdb138076
commit 1e6b40ebea
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
4 changed files with 378 additions and 439 deletions

View File

@ -95,7 +95,7 @@ if test $color_tests = yes; then
wht='' # White.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
red= grn= lgn= blu= mgn= std= wht=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'

View File

@ -40,7 +40,7 @@
"version_min":300000,
"title":"Testing XML request body parser (validate ok)",
"expected":{
"debug_log": "Target value: \"39.95\" \(Variable: XML:\/bookstore\/book\/price\[text\(\)\]\)"
"debug_log": "Target value: \"39.95\" \\(Variable: XML:\/bookstore\/book\/price\\[text\\(\\)\\]\\)"
},
"client":{
"ip":"200.249.12.31",

View File

@ -52,7 +52,8 @@
]
},
"expected":{
"debug_log":"Target value: \"Adding request argument (BODY): name \"b\", value \"22\.12\.22\.3\""
"debug_log":"Adding request argument \\(BODY\\): name \"b\", value \"22.12.22.3\"",
"http_code":403
},
"rules":[
"SecRuleEngine On",
@ -64,4 +65,3 @@
]
}
]

View File

@ -51,7 +51,7 @@
]
},
"expected":{
"debug_log":"Multipart: Boundary starts with white space, setting MULTIPART_STRICT_ERROR to 1"
"debug_log":"Multipart: Warning: boundary whitespace in C-T header"
},
"rules":[
"SecRuleEngine On",
@ -112,7 +112,7 @@
]
},
"expected":{
"debug_log":"Multipart: Boundary is quoted, setting MULTIPART_STRICT_ERROR to 1"
"debug_log":"Multipart: Warning: boundary was quoted."
},
"rules":[
"SecRuleEngine On",
@ -173,68 +173,7 @@
]
},
"expected":{
"debug_log":"Multipart: There is data after the boundary, setting MULTIPART_STRICT_ERROR to 1"
},
"rules":[
"SecRuleEngine On",
"SecDebugLog \/tmp\/modsec_debug.log",
"SecDebugLogLevel 9",
"SecRule MULTIPART_STRICT_ERROR \"@contains 0\" \"id:1,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: MULTIPART_STRICT_ERROR",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Content-Length":"330",
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
"Expect":"100-continue"
},
"uri":"/",
"method":"POST",
"body":[
"--------------------------756b6d74fa1a8ee2",
"Content-Disposition: form-data; name=\"name\"",
"",
"test",
"--------------------------756b6d74fa1a8ee2",
"Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"",
"Content-Type: text/plain",
"",
"This is a very small test file..",
"--------------------------756b6d74fa1a8ee2",
"Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"",
"Content-Type: text/plain",
"",
"This is another very small test file..",
"--------------------------756b6d74fa1a8ee2--"
]
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"debug_log":"Multipart: Lines are LF-terminated, setting MULTIPART_STRICT_ERROR to 1"
"debug_log":"Multipart: Warning: seen data before first boundary"
},
"rules":[
"SecRuleEngine On",
@ -295,7 +234,7 @@
]
},
"expected":{
"debug_log":"Warning: incorrect line endings used \(LF\)"
"debug_log":"Warning: incorrect line endings used \\(LF\\)"
},
"rules":[
"SecRuleEngine On",