I've finally added support for "normal" command/reply tests for my imaptest program (http://imapwiki.org/ImapTest).
My plan is that imaptest will include some generic IMAP compliancy tests and Dovecot will include some more strict Dovecot-specific checks. "make dist" will run all these tests before building a tarball, so in future I shouldn't be able to release horribly broken versions. :)
I haven't yet had time to implement all the features that I'd like (e.g. unordered list handling needs support), but I think the current features will allow testing quite a lot already. http://imapwiki.org/ImapTest/Tests explains how it works.
There are currently two files: the actual test file and *.mbox file where the mails are appended from to the test mailbox. I'm going to also add *.conf file which allows specifying specific dovecot.conf settings. This way I can test all these different namespace (etc.) variations as well.
A couple of examples to show what's possible:
# Check that EXAMINE and STATUS return same UIDVALIDITY examine $mailbox
- ok [uidvalidity $uidvalidity] ok [read-only] ok status $mailbox (uidvalidity)
- status $mailbox (uidvalidity $uidvalidity)
Test EXPUNGE handling with 2 connections:
connections: 2
1 ok fetch * uid
- $seq fetch (uid $uid) 1 ok store $seq flags \deleted
- $seq fetch (flags (\deleted \recent)) 1 ok expunge
- $seq expunge
2 ok fetch $seq uid
- $seq fetch (uid $uid) 2 ok noop
- $seq expunge
LIST testing:
state: auth
ok list "" ""
- list (\noselect) $sep ""
"" means that delete can return anything
# (although restricting it to "ok" or "no" would be better) delete $mailbox${sep}test "" delete $mailbox${sep}test2 "" ok create $mailbox${sep}test ok create $mailbox${sep}test2
ok list "" $mailbox$sep%
- list (\hasnochildren) $sep $mailbox${sep}test
- list (\hasnochildren) $sep $mailbox${sep}test2
On Thu, 2008-02-28 at 08:56 +0200, Timo Sirainen wrote:
I've finally added support for "normal" command/reply tests for my imaptest program (http://imapwiki.org/ImapTest).
And added more features to it. The only things in TODO list for it are:
- BODY.PEEK[HEADER.FIELDS (...)] should be converted to a single atom so it doen't break matching
- Literal handling?
- per-test dovecot.conf support
Now it would just needs tons of systematic tests of all IMAP commands and interactions with multiple connections. Any voluteers? :)
participants (1)
-
Timo Sirainen