Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (33 sloc) 1.266 kb
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
1 from base import *
2
3 DOMAIN = "wildcard1"
4 FILENAME = "test"
5 MAGIC1 = "This is virtual server wildcard1"
6 MAGIC2 = "This is virtual server *.wildcard1"
7
8 CONF = """
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-97f1...
alobbs authored
9 vserver!1390!nick = <domain>
10 vserver!1390!document_root = %s
b0dd10b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1398 5dc97367-97f1...
alobbs authored
11
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-97f1...
alobbs authored
12 vserver!1390!rule!1!match = default
13 vserver!1390!rule!1!handler = file
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
14
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-97f1...
alobbs authored
15 vserver!1391!nick = rest_<domain>
16 vserver!1391!document_root = %s
369157b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@3059 5dc97367-97f1...
alobbs authored
17 vserver!1391!match = wildcard
18 vserver!1391!match!domain!1 = *.<domain>
19
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-97f1...
alobbs authored
20 vserver!1391!rule!1!match = default
21 vserver!1391!rule!1!handler = file
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
22 """
23
24 class Test (TestBase):
25 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-97f1...
alobbs authored
26 TestBase.__init__ (self, __file__)
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
27 self.name = "Domain wildcards 1"
28
29 self.request = "GET /%s HTTP/1.1\r\n" % (FILENAME) +\
0684479 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1962 5dc97367-97f1...
alobbs authored
30 "Host: whatever.%s\r\n" % (DOMAIN) +\
31 "Connection: Close\r\n"
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
32
33 self.expected_error = 200
34 self.expected_content = MAGIC2
35
36
37 def Prepare (self, www):
38 d1 = self.Mkdir (www, "%s_dir1" % (DOMAIN))
39 d2 = self.Mkdir (www, "%s_dir2" % (DOMAIN))
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
40
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
41 self.WriteFile (d1, FILENAME, 0444, MAGIC1);
42 self.WriteFile (d2, FILENAME, 0444, MAGIC2);
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
43
7e2edaa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@591 5dc97367-97f1-...
alobbs authored
44
45 self.conf = CONF % (d1, d2)
46 self.conf = self.conf.replace ('<domain>', DOMAIN)
Something went wrong with that request. Please try again.