From afbcfc4f46b9dfed2a62b765b48455d7b7d631a2 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 30 Mar 2014 14:55:27 +0100 Subject: [PATCH] tests: Added email unit tests to verify login credential connection re-use --- tests/data/Makefile.am | 5 ++-- tests/data/test836 | 57 ++++++++++++++++++++++++++++++++++++++ tests/data/test882 | 56 +++++++++++++++++++++++++++++++++++++ tests/data/test938 | 63 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 tests/data/test836 create mode 100644 tests/data/test882 create mode 100644 tests/data/test938 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 59ccdfd12..9bd4053ad 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -67,17 +67,18 @@ test800 test801 test802 test803 test804 test805 test806 test807 test808 \ test809 test810 test811 test812 test813 test814 test815 test816 test817 \ test818 test819 test820 test821 test822 test823 test824 test825 test826 \ test827 test828 test829 test830 test831 test832 test833 test834 test835 \ +test836 \ \ test850 test851 test852 test853 test854 test855 test856 test857 test858 \ test859 test860 test861 test862 test863 test864 test865 test866 test867 \ test868 test869 test870 test871 test872 test873 test874 test875 test876 \ -test877 test878 test879 test880 test881 \ +test877 test878 test879 test880 test881 test882 \ \ 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 \ +test936 test937 test938 \ \ test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \ test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \ diff --git a/tests/data/test836 b/tests/data/test836 new file mode 100644 index 000000000..19731ab67 --- /dev/null +++ b/tests/data/test836 @@ -0,0 +1,57 @@ + + + +IMAP +Clear Text +FETCH +connection re-use + + + +# +# Server-side + + +REPLY "LOGIN user.one secret" A002 OK LOGIN completed +REPLY "LOGIN user.two secret" B002 OK LOGIN completed + + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely + + + +# +# Client-side + + +imap + + +IMAP multiple connection authentication + + +'imap://%HOSTIP:%IMAPPORT/836/;UID=1' -u user.one:secret -: 'imap://%HOSTIP:%IMAPPORT/836/;UID=2' -u user.two:secret + + + +# +# Verify data after the test has been "shot" + + +A001 CAPABILITY +A002 LOGIN user.two secret +A003 SELECT 836 +A004 FETCH 1 BODY[] +A005 LOGOUT +B001 CAPABILITY +B002 LOGIN user.two secret +B003 SELECT 836 +B004 FETCH 2 BODY[] +B005 LOGOUT + diff --git a/tests/data/test882 b/tests/data/test882 new file mode 100644 index 000000000..3e52836d2 --- /dev/null +++ b/tests/data/test882 @@ -0,0 +1,56 @@ + + + +POP3 +Clear Text +RETR +connection re-use + + + +# +# Server-side + + +REPLY "PASS secret" +OK Login successful + + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely + + + +# +# Client-side + + +pop3 + + +POP3 multiple connection authentication + + +pop3://%HOSTIP:%POP3PORT/882001 -u user.one:secret -: pop3://%HOSTIP:%POP3PORT/882002 -u user.two:secret + + + +# +# Verify data after the test has been "shot" + + +CAPA +USER user.one +PASS secret +RETR 882001 +QUIT +CAPA +USER user.two +PASS secret +RETR 882002 +QUIT + diff --git a/tests/data/test938 b/tests/data/test938 new file mode 100644 index 000000000..5f7a715c8 --- /dev/null +++ b/tests/data/test938 @@ -0,0 +1,63 @@ + + + +SMTP +SASL +SASL AUTH PLAIN +connection re-use +RFC4616 +RFC4954 + + + +# +# Server-side + + +AUTH PLAIN +REPLY AUTH 334 PLAIN supported +REPLY dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 235 Authenticated +REPLY dXNlci50d28AdXNlci50d28Ac2VjcmV0 235 Authenticated + + + +# +# Client-side + + +smtp + + +SMTP multiple connection authentication + + +mail body + + +smtp://%HOSTIP:%SMTPPORT/938001 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.one:secret -T - -: smtp://%HOSTIP:%SMTPPORT/938002 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.two:secret -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 938001 +AUTH PLAIN +dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT +EHLO 938002 +AUTH PLAIN +dXNlci50d28AdXNlci50d28Ac2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT + + +mail body +. +