Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 43 lines (35 sloc) 1.529 kB
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1 import os
2 from base import *
3
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
4 CONF = """
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-9…
alobbs authored
5 vserver!0660!nick = directoryindex3
6 vserver!0660!document_root = %s
7 vserver!0660!directory_index = index.php,/super_test_index.php
8 vserver!0660!rule!1!match = default
9 vserver!0660!rule!1!handler = common
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
10 """
11
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
12 class Test (TestBase):
13 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-9…
alobbs authored
14 TestBase.__init__ (self, __file__)
a6e0bc6 @alobbs Rewrites the QA so it stops checking whether the main QA application
alobbs authored
15 self.name = "Directory indexer, /index, vbles"
16 self.request = "GET /inside/ HTTP/1.0\r\n" +\
17 "Host: directoryindex3\r\n"
18 self.expected_error = 200
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
19
20 def Prepare (self, www):
a6e0bc6 @alobbs Rewrites the QA so it stops checking whether the main QA application
alobbs authored
21 # Generate files and dir
22 self.dr = self.Mkdir (www, "directoryindex3")
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
23 self.Mkdir (www, "directoryindex3/inside/foo")
24
25 self.WriteFile (self.dr, "super_test_index.php", 0666, """<?php
fe0ecb6 @alobbs A few warning were being printed by PHP. This patch fixes a few
alobbs authored
26 echo "DocumentRoot ".$_SERVER['DOCUMENT_ROOT']."\n";
27 echo "ScriptName " .$_SERVER['SCRIPT_NAME']."\n";
28 echo "RequestUri " .$_SERVER['REQUEST_URI']."\n";
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
29 ?>""")
30
a6e0bc6 @alobbs Rewrites the QA so it stops checking whether the main QA application
alobbs authored
31 # Set the configuration
32 self.conf = CONF % (self.dr)
33 for php in self.php_conf.split("\n"):
34 self.conf += "vserver!0660!rule!%s\n" % (php)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
35
a6e0bc6 @alobbs Rewrites the QA so it stops checking whether the main QA application
alobbs authored
36 # Expected output
37 self.expected_content = ["DocumentRoot %s" % (self.dr),
38 "ScriptName /super_test_index.php",
39 "RequestUri /inside/"]
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
40
a6e0bc6 @alobbs Rewrites the QA so it stops checking whether the main QA application
alobbs authored
41 def Precondition (self):
42 return os.path.exists (look_for_php())
Something went wrong with that request. Please try again.