aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-08-29 20:08:27 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-08-29 20:08:27 +0100
commit2ef83136d4e6919fc6571bb8091748a56df3c60a (patch)
tree0dc1ae603abcc8fd606043d064352b7fb24bd781
parentd737aa19c89f12c1415637a60afc79a6ea9c649f (diff)
ftpserver.pl: Updated IMAP EXAMINE handler to use dynamic test data
-rwxr-xr-xtests/ftpserver.pl23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 2655575b8..2756e07ca 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -1001,14 +1001,21 @@ sub EXAMINE_imap {
logmsg "EXAMINE_imap got test $testno\n";
- # Example from RFC 3501, 6.3.2. EXAMINE Command
- sendcontrol "* 17 EXISTS\r\n";
- sendcontrol "* 2 RECENT\r\n";
- sendcontrol "* OK [UNSEEN 8] Message 8 is first unseen\r\n";
- sendcontrol "* OK [UIDVALIDITY 3857529045] UIDs valid\r\n";
- sendcontrol "* OK [UIDNEXT 4392] Predicted next UID\r\n";
- sendcontrol "* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n";
- sendcontrol "* OK [PERMANENTFLAGS ()] No permanent flags permitted\r\n";
+ $testno =~ s/[^0-9]//g;
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "data$testpart");
+
+ for my $d (@data) {
+ sendcontrol $d;
+ }
+
sendcontrol "$cmdid OK [READ-ONLY] EXAMINE completed\r\n";
return 0;