tests: Added email unit tests to verify login credential connection re-use
authorSteve Holme <steve_holme@hotmail.com>
Sun, 30 Mar 2014 13:55:27 +0000 (14:55 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 30 Mar 2014 14:13:31 +0000 (15:13 +0100)
tests/data/Makefile.am
tests/data/test836 [new file with mode: 0644]
tests/data/test882 [new file with mode: 0644]
tests/data/test938 [new file with mode: 0644]

index 59ccdfd..9bd4053 100644 (file)
@@ -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 (file)
index 0000000..19731ab
--- /dev/null
@@ -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\r
+REPLY "LOGIN user.two secret" B002 OK LOGIN completed\r
+</servercmd>
+<data>
+From: me@somewhere\r
+To: fake@nowhere\r
+\r
+body\r
+\r
+--\r
+  yours sincerely\r
+</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\r
+A002 LOGIN user.two secret\r
+A003 SELECT 836\r
+A004 FETCH 1 BODY[]\r
+A005 LOGOUT\r
+B001 CAPABILITY\r
+B002 LOGIN user.two secret\r
+B003 SELECT 836\r
+B004 FETCH 2 BODY[]\r
+B005 LOGOUT\r
+</protocol>
diff --git a/tests/data/test882 b/tests/data/test882
new file mode 100644 (file)
index 0000000..3e52836
--- /dev/null
@@ -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\r
+</servercmd>
+<data>
+From: me@somewhere\r
+To: fake@nowhere\r
+\r
+body\r
+\r
+--\r
+  yours sincerely\r
+</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\r
+USER user.one\r
+PASS secret\r
+RETR 882001\r
+QUIT\r
+CAPA\r
+USER user.two\r
+PASS secret\r
+RETR 882002\r
+QUIT\r
+</protocol>
diff --git a/tests/data/test938 b/tests/data/test938
new file mode 100644 (file)
index 0000000..5f7a715
--- /dev/null
@@ -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\r
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP multiple connection authentication
+ </name>
+<stdin>
+mail body\r
+</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\r
+AUTH PLAIN\r
+dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0\r
+MAIL FROM:<sender@example.com>\r
+RCPT TO:<recipient@example.com>\r
+DATA\r
+QUIT\r
+EHLO 938002\r
+AUTH PLAIN\r
+dXNlci50d28AdXNlci50d28Ac2VjcmV0\r
+MAIL FROM:<sender@example.com>\r
+RCPT TO:<recipient@example.com>\r
+DATA\r
+QUIT\r
+</protocol>
+<upload>
+mail body\r
+.\r
+</upload>