# HG changeset patch # User Paul Boddie # Date 1459718491 -7200 # Node ID bfa410ae3d635c855b7c36c6449f4d9b40522885 # Parent 1cd51c7b72e7345dade28e52ec4b303d7965fc15 Updated the testing guide to cover mail integration testing, adding the convenience script for sending mail. diff -r 1cd51c7b72e7 -r bfa410ae3d63 docs/wiki/Testing --- a/docs/wiki/Testing Sun Apr 03 22:41:28 2016 +0200 +++ b/docs/wiki/Testing Sun Apr 03 23:21:31 2016 +0200 @@ -90,6 +90,19 @@ are presented with message content, and testing for the desired effects of running those programs with such content. +{{{ +./test_all.sh +}}} + +To run all tests against a different data store, such as a +[[../DatabaseStore|database store]] instead of the [[../FileStore|file store]], +the `STORE_TYPE` environment variable can be specified as in the following +example: + +{{{ +STORE_TYPE=postgresql ./test_all.sh +}}} + Individual tests may also be run directly from the topmost level of the source code distribution. For example: @@ -104,3 +117,50 @@ output from various commands from the last test script invocation; the `err.tmp` will contain tracebacks indicating serious error conditions, should any have occurred. + +== Testing in the Deployment Environment == + +Although the above testing may indicate that the software is functional, +it does not demonstrate that the software has been successfully integrated +into the deployment environment. One elementary test involves sending mail +to an address that should be configured to handle incoming calendar messages. + +A basic script is provided that replicates a subset of the functionality in +the traditional `mail` command for sending messages. It is invoked by +specifying the sender and recipients of a message and by passing the message +itself to the script's standard input. For example: + +{{{ +tools/sendmail.py paul.boddie@example.com resource-room-confroom@example.com \ + < tests/templates/event-request.txt +}}} + +Here, the sender (`paul.boddie@example.com`) and recipient +(`resource-room-confroom@example.com`) must match the identities specified +within the supplied file (`tests/templates/event-request.txt`), and for a +specific deployment environment these identities will need to be changed. +The following lines from the supplied file would be involved: + +{{{ +From: paul.boddie@example.com +To: resource-room-confroom@example.com +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE;ROLE=CHAIR:mailto:paul.boddie@example.com +ATTENDEE;RSVP=TRUE:mailto:resource-room-confroom@example.com +}}} + +It makes most sense to choose a recipient acting as a resource so that an +automated response may be generated with the sender receiving this response. +However, other kinds of recipients may also be tested in this way. + +The result of this invocation will become known via the following sources of +information: + + * The sender's mailbox (if the recipient sends an automated response) + * The sender's data store + * The recipient's mailbox (if the recipient is configured to store mail) + * The recipient's data store + * Mail system logs (particularly in case of errors) + +See the [[../MailIntegration|mail integration guide]] for more information +about configuring and troubleshooting mail systems. diff -r 1cd51c7b72e7 -r bfa410ae3d63 tools/sendmail.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/sendmail.py Sun Apr 03 23:21:31 2016 +0200 @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +import smtplib +import sys + +sender, recipients = sys.argv[1], sys.argv[2:] + +s = smtplib.SMTP("localhost") +print s.sendmail(sender, recipients, sys.stdin.read())