Skip to content

Commit

Permalink
test: add test cases for sasl external authentication (imap/pop3/smtp).
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Monnerat committed Jan 27, 2015
1 parent fe79f20 commit ed9a4b9
Show file tree
Hide file tree
Showing 13 changed files with 674 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/data/Makefile.inc
Expand Up @@ -97,7 +97,8 @@ test900 test901 test902 test903 test904 test905 test906 test907 test908 \
test909 test910 test911 test912 test913 test914 test915 test916 test917 \
test918 test919 test920 test921 test922 test923 test924 test925 test926 \
test927 test928 test929 test930 test931 test932 test933 test934 test935 \
test936 test937 test938 test939 test940 test941 \
test936 test937 test938 test939 test940 test941 test942 test943 test944 \
test945 test946 test947 test948 test949 test950 test951 test952 test953 \
\
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
Expand Down
56 changes: 56 additions & 0 deletions tests/data/test942
@@ -0,0 +1,56 @@
<testcase>
<info>
<keywords>
IMAP
SASL
SASL AUTH EXTERNAL
RFC4422
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
REPLY AUTHENTICATE +
REPLY dXNlcg== A002 OK AUTHENTICATE completed
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
imap
</server>
<name>
IMAP external authentication
</name>
<command>
'imap://user;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/942/;UID=1'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE EXTERNAL
dXNlcg==
A003 SELECT 942
A004 FETCH 1 BODY[]
A005 LOGOUT
</protocol>
</verify>
</testcase>
56 changes: 56 additions & 0 deletions tests/data/test943
@@ -0,0 +1,56 @@
<testcase>
<info>
<keywords>
IMAP
SASL
SASL AUTH EXTERNAL
RFC4422
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
REPLY AUTHENTICATE +
REPLY = A002 OK AUTHENTICATE completed
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
imap
</server>
<name>
IMAP external authentication without credentials
</name>
<command>
'imap://;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/943/;UID=1'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE EXTERNAL
=
A003 SELECT 943
A004 FETCH 1 BODY[]
A005 LOGOUT
</protocol>
</verify>
</testcase>
56 changes: 56 additions & 0 deletions tests/data/test944
@@ -0,0 +1,56 @@
<testcase>
<info>
<keywords>
IMAP
SASL
SASL AUTH EXTERNAL
SASL-IR
RFC4422
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
CAPA SASL-IR
REPLY AUTHENTICATE A002 OK AUTHENTICATE completed
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
imap
</server>
<name>
IMAP external authentication with initial response
</name>
<command>
'imap://user;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/944/;UID=1'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE EXTERNAL dXNlcg==
A003 SELECT 944
A004 FETCH 1 BODY[]
A005 LOGOUT
</protocol>
</verify>
</testcase>
56 changes: 56 additions & 0 deletions tests/data/test945
@@ -0,0 +1,56 @@
<testcase>
<info>
<keywords>
IMAP
SASL
SASL AUTH EXTERNAL
SASL-IR
RFC4422
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
CAPA SASL-IR
REPLY AUTHENTICATE A002 OK AUTHENTICATE completed
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
imap
</server>
<name>
IMAP external authentication with initial response without credentials
</name>
<command>
'imap://;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/945/;UID=1'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE EXTERNAL =
A003 SELECT 945
A004 FETCH 1 BODY[]
A005 LOGOUT
</protocol>
</verify>
</testcase>
57 changes: 57 additions & 0 deletions tests/data/test946
@@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
POP3
SASL
SASL AUTH EXTERNAL
RFC1734
RFC4422
RFC5034
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
REPLY AUTH +
REPLY dXNlcg== +OK Login successful
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
pop3
</server>
<name>
POP3 external authentication
</name>
<command>
'pop3://user;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/946'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
CAPA
AUTH EXTERNAL
dXNlcg==
RETR 946
QUIT
</protocol>
</verify>
</testcase>
57 changes: 57 additions & 0 deletions tests/data/test947
@@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
POP3
SASL
SASL AUTH EXTERNAL
RFC1734
RFC4422
RFC5034
</keywords>
</info>

#
# Server-side
<reply>
<servercmd>
AUTH EXTERNAL
REPLY AUTH +
REPLY = +OK Login successful
</servercmd>
<data>
From: me@somewhere
To: fake@nowhere

body

--
yours sincerely
</data>
</reply>

#
# Client-side
<client>
<server>
pop3
</server>
<name>
POP3 external authentication without credentials
</name>
<command>
'pop3://;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/947'
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
CAPA
AUTH EXTERNAL
=
RETR 947
QUIT
</protocol>
</verify>
</testcase>

0 comments on commit ed9a4b9

Please sign in to comment.