Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 27 lines (20 sloc) 0.867 kb
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
1 import random
2 import string
3 from base import *
4 from util import *
5
6 class Test (TestBase):
7 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-97f1...
alobbs authored
8 TestBase.__init__ (self, __file__)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
9 self.name = "Huge POST, 1Mb"
10 self.expected_error = 200
11
12 def Prepare (self, www):
13 random = "BEGIN(" + (letters_random (5*1024) * 200) + ")END"
14 tmpfile = self.WriteTemp (random)
15
16 self.request = "POST /Post1Mb.php HTTP/1.0\r\n" +\
17 "Content-type: application/x-www-form-urlencoded\r\n" +\
18 "Content-length: %d\r\n" % (4+len(random))
19 self.post = "var="+random
20 self.expected_content = "file:%s" % (tmpfile)
21
22 self.WriteFile (www, "Post1Mb.php", 0444, "<?php echo $_POST['var']; ?>")
23
24 def Precondition (self):
327c12c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@491 5dc97367-97f1-...
alobbs authored
25 return os.path.exists (look_for_php())
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
26
Something went wrong with that request. Please try again.