# # $Id$ # # QS_VipHeaderName X-Login drop # QS_LocRequestLimitMatch ^/htt/limit2/.* 2 # INCLUDE scripts/ports CLIENT 2 _SLEEP 500 # first two clients are allowed _REQ localhost $QS_PORT_BASE __GET /htt/limit2/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __ _EXPECT . "==AS1==" _WAIT _CLOSE END CLIENT 2 _REQ localhost $QS_PORT_BASE __GET /htt/limit2/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __ _MATCH headers "Set-Cookie: MODQOS=(.*); Path" COOKIE _EXPECT . "==AS1==" _WAIT _CLOSE _SLEEP 1000 _REQ localhost $QS_PORT_BASE __GET /qos?auto HTTP/1.1 __Host: localhost __Connection: keep-alive __ _EXPECT . "QS_LocRequestLimitMatch;2\[\^/htt/limit2/\.\*\]: 2" _WAIT _SLEEP 100 # no more requests allowed _REQ localhost $QS_PORT_BASE __GET /htt/limit2/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __ _EXPECT . "503 Service" _EXPECT . "custom error page" _EXPECT . "code=010" _WAIT _CLOSE _SLEEP 100 _EXPECT EXEC "mod_qos\(010\): access denied, QS_LocRequestLimit\* rule: \^/htt/limit2/\.\*\(2\), concurrent requests=" _EXEC tail -1 logs/error_log # allowed when sending a cookie _REQ localhost $QS_PORT_BASE __GET /htt/limit2/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __Cookie: MODQOS=${COOKIE} __ _EXPECT . "==AS1==" _WAIT END SERVER $QS_PORT_BASE6 2 _RES _WAIT __HTTP/1.1 200 OK __Content-Type: text/plain __Content-Length: AUTO __X-Login: authenticated __ __==AS1== _CLOSE _RES _WAIT __HTTP/1.1 200 OK __Content-Type: text/plain __Content-Length: 9 __ _SLEEP 1050 __==AS1== _CLOSE _RES _WAIT __HTTP/1.1 200 OK __Content-Type: text/plain __Content-Length: AUTO __ __==AS1== END