Modified: CalDAVTester/trunk/odsetup.py (3621 => 3622)
--- CalDAVTester/trunk/odsetup.py 2009-01-29 00:20:08 UTC (rev 3621)
+++ CalDAVTester/trunk/odsetup.py 2009-01-29 17:48:12 UTC (rev 3622)
@@ -161,13 +161,27 @@
hostname = plist["ServerHostName"]
docroot = plist["DocumentRoot"]
sudoers = plist["SudoersFile"]
+ try:
+ basic_ok = plist["Authentication"]["Basic"]["Enabled"]
+ except KeyError:
+ pass
+ try:
+ digest_ok = plist["Authentication"]["Digest"]["Enabled"]
+ except KeyError:
+ pass
+ if basic_ok:
+ authtype = "basic"
+ elif digest_ok:
+ authtype = "digest"
+ if not hostname:
+ hostname = "localhost"
if docroot[0] != "/":
docroot = base_dir + docroot
if sudoers[0] != "/":
sudoers = base_dir + sudoers
- return hostname, docroot, sudoers
+ return hostname, authtype, docroot, sudoers
def patchConfig(config, admin):
"""
@@ -199,7 +213,7 @@
users.append({"username":"superuser", "password": "superuser"})
writePlist(plist, sudoers)
-def buildServerinfo(hostname, docroot):
+def buildServerinfo(hostname, authtype, docroot):
# Read in the serverinfo-template.xml file
fd = open(serverinfo_template, "r")
@@ -236,6 +250,7 @@
data = data % {
"hostname" : hostname,
+ "authtype" : authtype,
"overrides" : subs_str,
}
@@ -375,7 +390,7 @@
if args[0] == "create":
# Read the caldavd.plist file and extract some information we will need.
- hostname, docroot, sudoers = readConfig(config)
+ hostname, authtype, docroot, sudoers = readConfig(config)
# Patch the sudoers file for the superuser principal.
patchSudoers(sudoers)
@@ -387,20 +402,20 @@
patchConfig(config, "/principals/__uids__/%s/" % (guids["testadmin"],))
# Create an appropriate serverinfo.xml file from the template
- buildServerinfo(hostname, docroot)
+ buildServerinfo(hostname, authtype, docroot)
# Add large calendars to user account
addLargeCalendars(hostname, docroot)
elif args[0] == "create-users":
# Read the caldavd.plist file and extract some information we will need.
- hostname, docroot, sudoers = readConfig(config)
+ hostname, authtype, docroot, sudoers = readConfig(config)
# Now generate the OD accounts (caching guids as we go).
doToAccounts(createUser, users_only=True)
# Create an appropriate serverinfo.xml file from the template
- buildServerinfo(hostname, docroot)
+ buildServerinfo(hostname, authtype, docroot)
elif args[0] == "remove":
doToAccounts(removeUser)
Modified: CalDAVTester/trunk/scripts/server/serverinfo-template.xml (3621 => 3622)
--- CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2009-01-29 00:20:08 UTC (rev 3621)
+++ CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2009-01-29 17:48:12 UTC (rev 3622)
@@ -21,7 +21,7 @@
<serverinfo>
<host>%(hostname)s</host>
<port>8008</port>
- <authtype>basic</authtype>
+ <authtype>%(authtype)s</authtype>
<substitutions>
<substitution>
<key>$host:</key>
Modified: CalDAVTester/trunk/scripts/tests/acl.xml (3621 => 3622)
--- CalDAVTester/trunk/scripts/tests/acl.xml 2009-01-29 00:20:08 UTC (rev 3621)
+++ CalDAVTester/trunk/scripts/tests/acl.xml 2009-01-29 17:48:12 UTC (rev 3622)
@@ -1204,7 +1204,7 @@
</test>
<test name='5' ignore='no'>
<description>Bogus authenticated get on non-existent inaccessible resource</description>
- <request user="admin" pswd="foobar">
+ <request user="$useradmin:" pswd="foobar">
<method>GET</method>
<ruri>$pathprefix1:/calendar-bogus/</ruri>
<verify>
@@ -1218,7 +1218,7 @@
</test>
<test name='6' ignore='no'>
<description>Bogus authenticated get on existing inaccessible resource</description>
- <request user="admin" pswd="foobar">
+ <request user="$useradmin:" pswd="foobar">
<method>GET</method>
<ruri>$calendarpath1:/1.ics</ruri>
<verify>