List Info

Thread: imaptest update




imaptest update
country flaguser name
Finland
2008-02-28 00:50:07
I've finally added support for "normal"
command/reply tests for my
imaptest program (http://imapwiki.org/Imap
Test). imaptest will include
generic tests that should work with all IMAP servers, but it
would be
easy for servers to implement their own private tests that
check things
more carefully (but less portably). It would be nice if
others could
provide some generic test cases as well.

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.or
g/ImapTest/Tests explains how it works.

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 ""

delete $mailbox$test
""
delete $mailbox$test2
""
ok create $mailbox$test
ok create $mailbox$test2

ok list "" $mailbox$sep%
* list (hasnochildren) $sep $mailbox$test
* list (hasnochildren) $sep $mailbox$test2


_______________________________________________
Imap-protocol mailing list
Imap-protocolu.washington.edu
https://mailman1.u.washington.edu/mailman/listin
fo/imap-protocol
Re: imaptest update
country flaguser name
Finland
2008-02-28 16:06:23
On Thu, 2008-02-28 at 08:50 +0200, Timo Sirainen wrote:
> A couple of examples to show what's possible:

I added a few more features to make it support pretty much
any test I
can think of:

# $n maps to sequences at the beginning of a command:
connections: 2

1 ok store 1,3 +flags deleted
1 ok expunge
* $1 expunge
* $3 expunge

2 ok uid fetch 2,4 uid
* $1 expunge
* $2 fetch (uid 2)
* $3 expunge
* $4 fetch (uid 4)

The second matches regardless of in what order server sends
the
fetch/expunge replies.

# $!directives to specify ordering rules in lists:
ok status $mailbox (messages recent)
* status $mailbox ($!unordered=2 messages 2 recent 2)

The above matches any of:
* status mailbox (messages 2 recent 2)
* status mailbox (recent 2 messages 2)
* status mailbox (recent 2 extension () messages 2 more
stuff)

# If the extra isn't wanted:
ok fetch 1 flags
* 1 fetch ($unordered=2 flags ($!unordered $noextra seen
draft))

These $!directives aren't actually required for the above
standard
untagged replies (fetch, fetch flags, status, list) because
they're
added by default.

_______________________________________________
Imap-protocol mailing list
Imap-protocolu.washington.edu
https://mailman1.u.washington.edu/mailman/listin
fo/imap-protocol
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )