[CalendarServer-changes] [13356] CalendarServer/trunk/contrib/performance

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 21 17:06:53 PDT 2014


Revision: 13356
          http://trac.calendarserver.org//changeset/13356
Author:   sagen at apple.com
Date:     2014-04-21 17:06:52 -0700 (Mon, 21 Apr 2014)
Log Message:
-----------
The sim now uses the realm advertised from the server

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/httpauth.py
    CalendarServer/trunk/contrib/performance/loadtest/population.py

Modified: CalendarServer/trunk/contrib/performance/httpauth.py
===================================================================
--- CalendarServer/trunk/contrib/performance/httpauth.py	2014-04-21 23:49:06 UTC (rev 13355)
+++ CalendarServer/trunk/contrib/performance/httpauth.py	2014-04-22 00:06:52 UTC (rev 13356)
@@ -24,15 +24,6 @@
 
 class BasicChallenge(object):
     def __init__(self, realm):
-        # The sim has no real reason to differentiate between credentials by
-        # realm.  It will only ever talk to a single realm.  Since the server
-        # being tested may have a different notion of its realm depending on
-        # various configuration issues, just ignore it and use the realm
-        # encoded in population.py.  It might be nice to someday properly
-        # handle realm values, but presently it would just be an additional
-        # configuration hassle.  See also DigestChallenge.
-        realm = "Test Realm"
-
         self.realm = realm
 
 
@@ -48,9 +39,6 @@
 
 class DigestChallenge(object):
     def __init__(self, realm, **fields):
-        # See the comment in BasicChallenge.
-        realm = "Test Realm"
-
         self.realm = realm
         self.fields = fields
         self.fields['realm'] = realm

Modified: CalendarServer/trunk/contrib/performance/loadtest/population.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/population.py	2014-04-21 23:49:06 UTC (rev 13355)
+++ CalendarServer/trunk/contrib/performance/loadtest/population.py	2014-04-22 00:06:52 UTC (rev 13356)
@@ -29,6 +29,7 @@
 from datetime import datetime
 from urllib2 import HTTPBasicAuthHandler
 from urllib2 import HTTPDigestAuthHandler
+from urllib2 import HTTPPasswordMgrWithDefaultRealm
 import collections
 import json
 import os
@@ -190,15 +191,15 @@
     def _createUser(self, number):
         record = self._records[number]
         user = record.uid
-        authBasic = HTTPBasicAuthHandler()
+        authBasic = HTTPBasicAuthHandler(passwd_mgr=HTTPPasswordMgrWithDefaultRealm())
         authBasic.add_password(
-            realm="Test Realm",
+            realm=None,
             uri=self.server,
             user=user.encode('utf-8'),
             passwd=record.password.encode('utf-8'))
-        authDigest = HTTPDigestAuthHandler()
+        authDigest = HTTPDigestAuthHandler(passwd=HTTPPasswordMgrWithDefaultRealm())
         authDigest.add_password(
-            realm="Test Realm",
+            realm=None,
             uri=self.server,
             user=user.encode('utf-8'),
             passwd=record.password.encode('utf-8'))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140421/477baf20/attachment.html>


More information about the calendarserver-changes mailing list