aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-03-30 14:55:27 +0100
committerSteve Holme <steve_holme@hotmail.com>2014-03-30 15:13:31 +0100
commitafbcfc4f46b9dfed2a62b765b48455d7b7d631a2 (patch)
treee639cb888bf530c4c9bffc3b13bd9eab5c24ff63
parentb3e55bf98918158dacef5722fe85238a3c79db38 (diff)
tests: Added email unit tests to verify login credential connection re-use
-rw-r--r--tests/data/Makefile.am5
-rw-r--r--tests/data/test83657
-rw-r--r--tests/data/test88256
-rw-r--r--tests/data/test93863
4 files changed, 179 insertions, 2 deletions
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 @@
+<testcase>
+<info>
+<keywords>
+IMAP
+Clear Text
+FETCH
+connection re-use
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY "LOGIN user.one secret" A002 OK LOGIN completed
+REPLY "LOGIN user.two secret" B002 OK LOGIN completed
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+imap
+</server>
+ <name>
+IMAP multiple connection authentication
+ </name>
+ <command>
+'imap://%HOSTIP:%IMAPPORT/836/;UID=1' -u user.one:secret -: 'imap://%HOSTIP:%IMAPPORT/836/;UID=2' -u user.two:secret
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+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
+</protocol>
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 @@
+<testcase>
+<info>
+<keywords>
+POP3
+Clear Text
+RETR
+connection re-use
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY "PASS secret" +OK Login successful
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+pop3
+</server>
+ <name>
+POP3 multiple connection authentication
+ </name>
+ <command>
+pop3://%HOSTIP:%POP3PORT/882001 -u user.one:secret -: pop3://%HOSTIP:%POP3PORT/882002 -u user.two:secret
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+CAPA
+USER user.one
+PASS secret
+RETR 882001
+QUIT
+CAPA
+USER user.two
+PASS secret
+RETR 882002
+QUIT
+</protocol>
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 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SASL
+SASL AUTH PLAIN
+connection re-use
+RFC4616
+RFC4954
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH PLAIN
+REPLY AUTH 334 PLAIN supported
+REPLY dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 235 Authenticated
+REPLY dXNlci50d28AdXNlci50d28Ac2VjcmV0 235 Authenticated
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP multiple connection authentication
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+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 -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO 938001
+AUTH PLAIN
+dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0
+MAIL FROM:<sender@example.com>
+RCPT TO:<recipient@example.com>
+DATA
+QUIT
+EHLO 938002
+AUTH PLAIN
+dXNlci50d28AdXNlci50d28Ac2VjcmV0
+MAIL FROM:<sender@example.com>
+RCPT TO:<recipient@example.com>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+.
+</upload>