Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (32 sloc) 1.071 kb
e171bee Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-97f1...
alobbs authored
1 from base import *
2
3 MAGIC = "Rule AND: doesn't match"
4 DIR = "DirAnd2"
5 FILE = "test.cgi"
6
7 CONF = """
8e7efc4 Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1738 5dc97367-97f1...
alobbs authored
8 vserver!1!rule!1630!match = directory
9 vserver!1!rule!1630!match!directory = /%s
10 vserver!1!rule!1630!handler = cgi
11
12 vserver!1!rule!1631!match = and
13 vserver!1!rule!1631!match!left = directory
14 vserver!1!rule!1631!match!left!directory = /%s
15 vserver!1!rule!1631!match!right = extensions
16 vserver!1!rule!1631!match!right!extensions = not_cgi,other
17 vserver!1!rule!1631!handler = file
e171bee Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-97f1...
alobbs authored
18 """
19
20 CGI = """#!/bin/sh
21
22 echo "Content-Type: text/plain"
72f6444 Alvaro Lopez Ortega Clean up: Trims trailing spaces.
alobbs authored
23 echo
e171bee Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-97f1...
alobbs authored
24 echo "%s"
25 """ % (MAGIC)
26
27 class Test (TestBase):
28 def __init__ (self):
bc8d926 Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-97f1...
alobbs authored
29 TestBase.__init__ (self, __file__)
e171bee Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-97f1...
alobbs authored
30 self.name = "Rule and: not match"
31
72f6444 Alvaro Lopez Ortega Clean up: Trims trailing spaces.
alobbs authored
32 self.request = "GET /%s/%s HTTP/1.0\r\n" % (DIR, FILE)
e171bee Alvaro Lopez Ortega git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-97f1...
alobbs authored
33 self.expected_error = 200
34 self.expected_content = MAGIC
35 self.forbidden_content = ["/bin/sh", "echo"]
36 self.conf = CONF % (DIR, DIR)
37
38 def Prepare (self, www):
39 d = self.Mkdir (www, DIR)
40 f = self.WriteFile (d, FILE, 0755, CGI)
Something went wrong with that request. Please try again.