aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-03-29 10:29:03 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-03-29 10:29:17 +0000
commit3a29ee41ef72c3a50d889e744ffdce6419234388 (patch)
tree33348862229749e0ff6bacfbeff9df1c8d7071b4 /tests/ftpserver.pl
parentfe260b75e74fed56573d133dd64d2424660743cb (diff)
ftpserver.pl: Introduced common method for getting a test's reply data
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 0116e2073..2eed040d4 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -436,6 +436,25 @@ sub startsf {
}
}
+#**********************************************************************
+# Returns the given test's reply data
+#
+sub getreplydata {
+ my ($testno) = @_;
+ my $testpart = "";
+
+ $testno =~ s/^([^0-9]*)//
+ if($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "data$testpart");
+
+ return @data;
+}
sub sockfilt {
my $l;
@@ -445,7 +464,6 @@ sub sockfilt {
}
}
-
sub sockfiltsecondary {
my $l;
foreach $l (@_) {
@@ -454,10 +472,10 @@ sub sockfiltsecondary {
}
}
-
+#**********************************************************************
# Send data to the client on the control stream, which happens to be plain
# stdout.
-
+#
sub sendcontrol {
if(!$ctrldelay) {
# spit it all out at once