| 17 | | * [wiki:CalDAVTesterGetting Get it] |
| 18 | | * [wiki:CalDAVTesterConfigure Configure it] |
| 19 | | * [wiki:CalDAVTesterRunning Run it] |
| | 17 | == Getting CalDAVTester Source Code == |
| | 18 | |
| | 19 | 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. |
| | 20 | |
| | 21 | ''' Browsing the sources ''' |
| | 22 | |
| | 23 | You can browse the repository in two ways: |
| | 24 | |
| | 25 | 1. [/projects/calendarserver/browser Via Trac] |
| | 26 | 1. [http://svn.macosforge.org/repository/calendarserver/ Directly via Subversion] |
| | 27 | |
| | 28 | 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. |
| | 29 | |
| | 30 | 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. |
| | 31 | |
| | 32 | ''' Checking out the sources with Subversion ''' |
| | 33 | |
| | 34 | First, you will need a Subversion client. |
| | 35 | |
| | 36 | A list of pre-built executables of the Subversion command line client for various platforms is avaliable from [http://subversion.tigris.org/project_packages.html subversion.tigris.org]. Mac OS X users can get an installer from [http://metissian.com/projects/macosx/subversion/ metissian.com]. Mac OS X versions 10.5 (Leopard) and later include the Subversion command line client in the Developer Tools package. See the [http://svnbook.red-bean.com/ Subversion documentation] for details on using Subversion. |
| | 37 | |
| | 38 | 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: |
| | 39 | |
| | 40 | {{{ |
| | 41 | svn checkout http://svn.macosforge.org/repository/calendarserver/CalDAVTester/trunk CalDAVTester |
| | 42 | }}} |
| | 43 | |
| | 44 | Graphical clients which support Subversion are also available, including Apple's [http://developer.apple.com/tools/xcode/ XCode] IDE. Consult the documentation for your chosen client for information on how to check out source code. |
| | 45 | |
| | 46 | == Configuring CalDAVTester == |
| | 47 | |
| | 48 | 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. |
| | 49 | |
| | 50 | CalDAVTester uses XML files for its configuration and tests, and a series of data files for data sent to the server. |
| | 51 | |
| | 52 | - 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. |
| | 53 | |
| | 54 | - 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. |
| | 55 | |
| | 56 | |
| | 57 | == Running CalDAVTester == |
| | 58 | |
| | 59 | First make sure your CalDAV server is up and running, then do the following: |
| | 60 | |
| | 61 | cd into the CalendarServer directory |
| | 62 | |
| | 63 | {{{ |
| | 64 | ./testserver |
| | 65 | }}} |
| | 66 | |
| | 67 | This will run all CalDAV and CardDAV tests. |
| | 68 | |
| | 69 | If you want explicit control of what tests are run, do the following: |
| | 70 | |
| | 71 | cd into the CalDAVTester directory |
| | 72 | |
| | 73 | {{{ |
| | 74 | export PYTHONPATH=`./run.py -p` |
| | 75 | ./testcaldav.py <<testscriptfile>> |
| | 76 | }}} |
| | 77 | |
| | 78 | 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: |
| | 79 | |
| | 80 | {{{ |
| | 81 | ./testcaldav.py CalDAV/well-known.xml |
| | 82 | }}} |