[CalendarServer-changes] [3702] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Feb 20 13:13:48 PST 2009


Revision: 3702
          http://trac.macosforge.org/projects/calendarserver/changeset/3702
Author:   cdaboo at apple.com
Date:     2009-02-20 13:13:48 -0800 (Fri, 20 Feb 2009)
Log Message:
-----------
Fix to ensure OD and XML directory backed servers can both be tested with the same set of scripts.

Modified Paths:
--------------
    CalDAVTester/trunk/Resource/implicit/scenario1/organizerdelete/7.ics
    CalDAVTester/trunk/Resource/implicit/scenario1/recurring-alarms/9.ics
    CalDAVTester/trunk/odsetup.py
    CalDAVTester/trunk/scripts/server/serverinfo-template.xml
    CalDAVTester/trunk/scripts/tests/aclreports.xml
    CalDAVTester/trunk/scripts/tests/expandproperty.xml

Modified: CalDAVTester/trunk/Resource/implicit/scenario1/organizerdelete/7.ics
===================================================================
--- CalDAVTester/trunk/Resource/implicit/scenario1/organizerdelete/7.ics	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/Resource/implicit/scenario1/organizerdelete/7.ics	2009-02-20 21:13:48 UTC (rev 3702)
@@ -25,13 +25,13 @@
 DTSTART;TZID=US/Eastern:20060101T100000
 DURATION:PT1H
 ATTENDEE;CN=User 01;PARTSTAT=ACCEPTED;X-CALENDARSERVER-EMAIL=user01 at exampl
- e.com:urn:uuid:user01
+ e.com:$cuaddrurn1:
 ATTENDEE;CN=User 02;PARTSTAT=ACCEPTED;RSVP=TRUE;X-CALENDARSERVER-EMAIL=use
- r02 at example.com:urn:uuid:user02
+ r02 at example.com:$cuaddrurn2:
 CREATED:20060101T150000Z
 DTSTAMP:20051222T205953Z
 ORGANIZER;CN=User 01;SCHEDULE-STATUS="1.2;Scheduling message has been deli
- vered";X-CALENDARSERVER-EMAIL=user01 at example.com:urn:uuid:user01
+ vered";X-CALENDARSERVER-EMAIL=user01 at example.com:$cuaddrurn1:
 SUMMARY:event 2
 STATUS:CANCELLED
 END:VEVENT

Modified: CalDAVTester/trunk/Resource/implicit/scenario1/recurring-alarms/9.ics
===================================================================
--- CalDAVTester/trunk/Resource/implicit/scenario1/recurring-alarms/9.ics	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/Resource/implicit/scenario1/recurring-alarms/9.ics	2009-02-20 21:13:48 UTC (rev 3702)
@@ -24,11 +24,11 @@
 UID:event4-1 at ninevah.local
 DTSTART;TZID=US/Eastern:20060101T100000
 DURATION:PT1H
-ATTENDEE;CN=User 01;PARTSTAT=ACCEPTED;X-CALENDARSERVER-EMAIL=user01 at example.com:urn:uuid:user01
-ATTENDEE;CN=User 02;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;X-CALENDARSERVER-EMAIL=user02 at example.com:urn:uuid:user02
+ATTENDEE;CN=User 01;PARTSTAT=ACCEPTED;X-CALENDARSERVER-EMAIL=user01 at example.com:$cuaddrurn1:
+ATTENDEE;CN=User 02;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;X-CALENDARSERVER-EMAIL=user02 at example.com:$cuaddrurn2:
 CREATED:20060101T150000Z
 DTSTAMP:20051222T205953Z
-ORGANIZER;CN=User 01;X-CALENDARSERVER-EMAIL=user01 at example.com:urn:uuid:user01
+ORGANIZER;CN=User 01;X-CALENDARSERVER-EMAIL=user01 at example.com:$cuaddrurn1:
 SUMMARY:event 4-1 changed
 RRULE:FREQ=DAILY;COUNT=3
 TRANSP:TRANSPARENT
@@ -38,11 +38,11 @@
 UID:event4-1 at ninevah.local
 DTSTART;TZID=US/Eastern:20060102T100000
 DURATION:PT1H
-ATTENDEE;CN=User 01;PARTSTAT=ACCEPTED;X-CALENDARSERVER-EMAIL=user01 at example.com:urn:uuid:user01
-ATTENDEE;CN=User 02;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;X-CALENDARSERVER-EMAIL=user02 at example.com:urn:uuid:user02
+ATTENDEE;CN=User 01;PARTSTAT=ACCEPTED;X-CALENDARSERVER-EMAIL=user01 at example.com:$cuaddrurn1:
+ATTENDEE;CN=User 02;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;X-CALENDARSERVER-EMAIL=user02 at example.com:$cuaddrurn2:
 CREATED:20060101T150000Z
 DTSTAMP:20051222T205953Z
-ORGANIZER;CN=User 01;X-CALENDARSERVER-EMAIL=user01 at example.com:urn:uuid:user01
+ORGANIZER;CN=User 01;X-CALENDARSERVER-EMAIL=user01 at example.com:$cuaddrurn1:
 SUMMARY:event 4-1 changed
 TRANSP:TRANSPARENT
 X-APPLE-NEEDS-REPLY:TRUE

Modified: CalDAVTester/trunk/odsetup.py
===================================================================
--- CalDAVTester/trunk/odsetup.py	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/odsetup.py	2009-02-20 21:13:48 UTC (rev 3702)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #
 ##
-# Copyright (c) 2006-2008 Apple Inc. All rights reserved.
+# Copyright (c) 2006-2009 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -40,9 +40,8 @@
 number_of_users = 10
 
 guids = {
-    "testadmin": "",
-    "apprentice": "",
-    "group01"   :"",
+    "testadmin"  : "",
+    "apprentice" : "",
 }
 
 for i in range(1, 11):
@@ -51,6 +50,9 @@
     guids["resource%02d" % (i,)] = ""
     guids["location%02d" % (i,)] = ""
 
+for i in range(1, 5):
+    guids["group%02d" % (i,)] = ""
+
 # List of users as a tuple: (<<name>>, <<pswd>>, <<repeat count>>)
 adminattrs = {
     "dsAttrTypeStandard:RealName":        "Super User",
@@ -125,8 +127,7 @@
 }
 
 groupattrs = {
-    "dsAttrTypeStandard:RealName":        "Group 01",
-    "dsAttrTypeStandard:EMailAddress":    "group01 at example.com",
+        "dsAttrTypeStandard:RealName":        "Group %02d",
 }
 
 records = (
@@ -136,7 +137,7 @@
     ("/Users", "public%02d", "public%02d", publicattrs, 10),
     ("/Places", "location%02d", "location%02d", locationattrs, 10),
     ("/Resources", "resource%02d", "resource%02d", resourceattrs, 10),
-    ("/Groups", "group01", "group01", groupattrs, 1),
+    ("/Groups", "group%02d", "group%02d", groupattrs, 4),
 )
 
 def usage():
@@ -243,6 +244,8 @@
         subs.append(("$resourceguid%d:" % (i,), guids["resource%02d" % (i,)]))
     for i in range(1, 11):
         subs.append(("$locationguid%d:" % (i,), guids["location%02d" % (i,)]))
+    for i in range(1, 5):
+        subs.append(("$groupguid%d:" % (i,), guids["group%02d" % (i,)]))
     
     subs_str = ""
     for x, y in subs:
@@ -303,6 +306,28 @@
         else:
             f(record[0], record[1:])
 
+def doGroupMemberships():
+    
+    memberships = (
+        ("group01", ("user01",), (),),
+        ("group02", ("user06", "user07",), (),),
+        ("group03", ("user08", "user09",), (),),
+        ("group04", ("user10",), ("group02", "group03",),),
+    )
+    
+    for groupname, users, nestedgroups in memberships:
+        
+        memberGUIDs = [guids[user] for user in users]
+        nestedGUIDs = [guids[group] for group in nestedgroups]
+        
+        cmd = "dscl -u %s -P %s %s -append /Groups/%s \"dsAttrTypeStandard:GroupMembers\"%s" % (diradmin_user, diradmin_pswd, directory_node, groupname, "".join([" \"%s\"" % (guid,) for guid in memberGUIDs]))
+        print cmd
+        commands.getoutput(cmd)
+
+        cmd = "dscl -u %s -P %s %s -append /Groups/%s \"dsAttrTypeStandard:NestedGroups\"%s" % (diradmin_user, diradmin_pswd, directory_node, groupname, "".join([" \"%s\"" % (guid,) for guid in nestedGUIDs]))
+        print cmd
+        commands.getoutput(cmd)
+
 def createUser(path, user):
     # Do dscl command line operations to create a calendar user
     
@@ -397,6 +422,7 @@
     
             # Now generate the OD accounts (caching guids as we go).
             doToAccounts(createUser)
+            doGroupMemberships()
             
             # Patch the caldavd.plist file with the testadmin user's guid-based principal-URL
             patchConfig(config, "/principals/__uids__/%s/" % (guids["testadmin"],))

Modified: CalDAVTester/trunk/scripts/server/serverinfo-template.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-template.xml	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/scripts/server/serverinfo-template.xml	2009-02-20 21:13:48 UTC (rev 3702)
@@ -3,7 +3,7 @@
 <!DOCTYPE serverinfo SYSTEM "serverinfo.dtd">
 
 <!--
- Copyright (c) 2006-2008 Apple Inc. All rights reserved.
+ Copyright (c) 2006-2009 Apple Inc. All rights reserved.
 
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
@@ -481,8 +481,8 @@
 		</repeat>
 
 
-		<!--  One Group account -->
-		<repeat count="1">
+		<!--  Four Group accounts -->
+		<repeat count="4">
 			<substitution>
 				<key>$groupid%%d:</key>
 				<value>group%%02d</value>

Modified: CalDAVTester/trunk/scripts/tests/aclreports.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/aclreports.xml	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/scripts/tests/aclreports.xml	2009-02-20 21:13:48 UTC (rev 3702)
@@ -495,6 +495,7 @@
 						<value>$principaluri2:</value>
 						<value>$rprincipaluri2:</value>
 						<value>$lprincipaluri2:</value>
+						<value>$gprincipaluri2:</value>
 					</arg>
 				</verify>
 			</request>
@@ -741,21 +742,9 @@
 				<verify>
 					<callback>multistatusItems</callback>
 					<arg>
-						<name>prefix</name>
-						<value/>
+						<name>count</name>
+						<value>4</value> <!-- limit - 1 -->
 					</arg>
-					<arg>
-						<name>okhrefs</name>
-						<value>$principaluri1:</value>
-						<value>$principaluri2:</value>
-						<value>$principaluri3:</value>
-						<value>$principaluri4:</value>
-						<value>$principaluri5:</value>
-					</arg>
-					<arg>
-						<name>badhrefs</name>
-						<value>$calendarpath1:/1.ics</value>
-					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>

Modified: CalDAVTester/trunk/scripts/tests/expandproperty.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/expandproperty.xml	2009-02-20 21:11:00 UTC (rev 3701)
+++ CalDAVTester/trunk/scripts/tests/expandproperty.xml	2009-02-20 21:13:48 UTC (rev 3702)
@@ -243,7 +243,7 @@
 			<description>Non-expanding group-member-set query</description>
 			<request print-response="no">
 				<method>REPORT</method>
-				<ruri>$principals_uids:toplevelgroup/</ruri>
+				<ruri>$gprincipaluri4:/</ruri>
 				<data>
 					<content-type>text/xml; charset=utf-8</content-type>
 					<filepath>Resource/expandproperty/9.xml</filepath>
@@ -256,35 +256,35 @@
 					</arg>
 					<arg>
 						<name>okhrefs</name>
-						<value>$principals_uids:toplevelgroup/</value>
+						<value>$gprincipaluri4:/</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 14</value>
+						<value>$username10:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 1</value>
+						<value>$groupname2:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 2</value>
+						<value>$groupname3:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>notcontains</name>
-						<value>User 10</value>
+						<value>$username6:</value>
 					</arg>
 				</verify>
 			</request>
@@ -293,7 +293,7 @@
 			<description>Expanding group-member-set query</description>
 			<request print-response="no">
 				<method>REPORT</method>
-				<ruri>$principals_uids:toplevelgroup/</ruri>
+				<ruri>$gprincipaluri4:/</ruri>
 				<data>
 					<content-type>text/xml; charset=utf-8</content-type>
 					<filepath>Resource/expandproperty/10.xml</filepath>
@@ -306,72 +306,65 @@
 					</arg>
 					<arg>
 						<name>okhrefs</name>
-						<value>$principals_uids:toplevelgroup/</value>
+						<value>$gprincipaluri4:/</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 10</value>
+						<value>$username6:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 11</value>
+						<value>$username7:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 12</value>
+						<value>$username8:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 13</value>
+						<value>$username9:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>User 14</value>
+						<value>$username10:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 1</value>
+						<value>$groupname2:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 2</value>
+						<value>$groupname3:</value>
 					</arg>
 				</verify>
-				<verify>
-					<callback>dataString</callback>
-					<arg>
-						<name>contains</name>
-						<value>User 10</value>
-					</arg>
-				</verify>
 			</request>
 		</test>
 		<test name='3'>
 			<description>Non-expanding group-membership query</description>
 			<request print-response="no">
 				<method>REPORT</method>
-				<ruri>$principals_uids:user10/</ruri>
+				<ruri>$principaluri6:/</ruri>
 				<data>
 					<content-type>text/xml; charset=utf-8</content-type>
 					<filepath>Resource/expandproperty/11.xml</filepath>
@@ -384,14 +377,14 @@
 					</arg>
 					<arg>
 						<name>okhrefs</name>
-						<value>$principals_uids:user10/</value>
+						<value>$principaluri6:/</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 1</value>
+						<value>$groupname2:</value>
 					</arg>
 				</verify>
 			</request>
@@ -400,7 +393,7 @@
 			<description>Expanding group-membership query</description>
 			<request print-response="no">
 				<method>REPORT</method>
-				<ruri>$principals_uids:user10/</ruri>
+				<ruri>$principaluri6:/</ruri>
 				<data>
 					<content-type>text/xml; charset=utf-8</content-type>
 					<filepath>Resource/expandproperty/12.xml</filepath>
@@ -413,21 +406,21 @@
 					</arg>
 					<arg>
 						<name>okhrefs</name>
-						<value>$principals_uids:user10/</value>
+						<value>$principaluri6:/</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Sub Group 1</value>
+						<value>$groupname2:</value>
 					</arg>
 				</verify>
 				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
-						<value>Top Level Group</value>
+						<value>$groupname4:</value>
 					</arg>
 				</verify>
 			</request>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090220/9de99895/attachment-0001.html>


More information about the calendarserver-changes mailing list