Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (21 sloc) 0.814 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
from base import *

CONF = """
vserver!1!rule!850!match = directory
vserver!1!rule!850!match!directory = /auth1users
vserver!1!rule!850!match!final = 0
vserver!1!rule!850!auth = plain
vserver!1!rule!850!auth!methods = basic
vserver!1!rule!850!auth!realm = Test with Users
vserver!1!rule!850!auth!passwdfile = %s
vserver!1!rule!850!auth!users = foo,alo
"""

class Test (TestBase):
    def __init__ (self):
        TestBase.__init__ (self, __file__)
        self.name = "Auth basic, with users"
        self.request = "GET /auth1users/ HTTP/1.0\r\n"
        self.expected_error = 401

    def Prepare (self, www):
        d = self.Mkdir (www, "auth1users")
        self.WriteFile (d, "passwd", 0444, 'user:cherokee\n' + 'foo:bar\n' + 'sending:sos\n')

        self.conf = CONF % (d+"/passwd")
Something went wrong with that request. Please try again.