CalDAVTester: A CalDAV and CardDAV server test & performance suite
CalDAVTester is a test and performance application designed to work with CalDAV and / or CardDAV servers and tests various aspects of their protocol handling as well as performance.
CalDAVTester basically executes HTTP requests against a server and verifies the responses returned by the server. Suites of tests are defined in xml configuration files, and an additional xml configuration file is used to define variables used whilst running (e.g., server address, user accounts to use etc).
A test suite configuration file comprises the following items:
- A start section where resources needed for the tests can be created
- A set of test suites, comprising:
- A set of tests, each of which can have:
- A set of HTTP request/response/verify tests.
- A set of tests, each of which can have:
- An end section to do clean-up after the tests are all done.
The source code to CalDAVTester is available via a Subversion repository. You can obtain the code using a WebDAV client, or use Subversion to check it out from the repository.
Getting CalDAVTester Source Code
CalDAVTester is automatically retrieved by CalendarServer's 'run' script during its dependency resolution phase, and is stored as a sibling directory to CalendarServer, along with other externally retrieved dependencies.
Browsing the sources
You can browse the repository in two ways:
The Trac browser is particularly convenient for online browsing because it offers a few features that connecting directly to the Subversion server does not. In particular, it has a nice interface that allows you to view more information, including commit logs, change sets, and revision history.
One advantage of browsing the Subversion repository directory is that the URLs in your web browser are the same URLs you can use with Subversion commands.
Checking out the sources with Subversion
First, you will need a Subversion client.
A list of pre-built executables of the Subversion command line client for various platforms is avaliable from subversion.tigris.org. Mac OS X users can get an installer from metissian.com. Mac OS X versions 10.5 (Leopard) and later include the Subversion command line client in the Developer Tools package. See the Subversion documentation for details on using Subversion.
You can then use Subversion to obtain a working copy of the source code. The following command will check out the latest version of CalDAVTester:
svn checkout http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk CalDAVTester
Graphical clients which support Subversion are also available, including Apple's XCode IDE. Consult the documentation for your chosen client for information on how to check out source code.
As provided, CalDAVTester is already setup to operate with a Calendar Server running on the localhost using the caldavd-test.plist configuration. No changes are needed to the configuration files to run.
CalDAVTester uses XML files for its configuration and tests, and a series of data files for data sent to the server.
- The "serverinfo" configuration is stored in scripts/servers. That file defines details about the server being tested (its host name, port etc) as well as information about how the server is setup with user accounts for testing. CalDAVTester requires a certain number of user accounts to be present on the server being tested in order to perform the requird tests. The "serverinfo" configuration file allows you to specify the details for each account, including user name, password, path to calendars etc. These values are substituted into the tests via a string subtitution. The values can also be substituted into the data files as needed.
- The "caldavtest" test files are stored in scripts/tests. There are multiple test scripts each of which defines a set of tests to be executed against the server. Each test has a <start> section where any required setup can be done (e.g. storing resources on the server needed for the test), and an <end> section where clean-up can occur (e.g., removal of resources added during <start>). Multiple <test-suites> can be specified. Each suite can contain multiple <tests>. Each test can include one or more <request>'s. A request carries out an HTTP transaction with the server and optionally verifies the result.
First make sure your CalDAV server is up and running, then do the following:
cd into the CalendarServer directory
This will run all CalDAV and CardDAV tests.
If you want explicit control of what tests are run, do the following:
cd into the CalDAVTester directory
export PYTHONPATH=`./run.py -p` ./testcaldav.py <<testscriptfile>>
where <<testscriptfile>> is one of the .xml files in the CalDAVTester/scripts/test directory. For example, to run the 'well-known.xml' test for CalDAV, you would execute: