From 4427d91479d8e930ace86b42d2197b41ae01f870 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Feb 2004 09:19:59 +0000 Subject: [PATCH] runtests.pl now provides the srcdir to the ftpserver so that it can pass that to loadtest properly. --- tests/ftpserver.pl | 11 ++++++++--- tests/runtests.pl | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index b4442c6..064d949 100644 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -39,12 +39,17 @@ sub ftpmsg { my $verbose=0; # set to 1 for debugging my $retrweirdo=0; my $retrnosize=0; +my $srcdir="."; my $port = 8921; # just a default do { if($ARGV[0] eq "-v") { $verbose=1; } + elsif($ARGV[0] eq "-s") { + $srcdir=$ARGV[1]; + shift @ARGV; + } elsif($ARGV[0] =~ /^(\d+)$/) { $port = $1; } @@ -185,7 +190,7 @@ sub NLST_command { sub MDTM_command { my $testno = $_[0]; - loadtest("data/test$testno"); + loadtest("$srcdir/data/test$testno"); logmsg "MDTM $testno\n"; @@ -212,7 +217,7 @@ sub MDTM_command { sub SIZE_command { my $testno = $_[0]; - loadtest("data/test$testno"); + loadtest("$srcdir/data/test$testno"); logmsg "SIZE number $testno\n"; @@ -267,7 +272,7 @@ sub RETR_command { return 0; } - loadtest("data/test$testno"); + loadtest("$srcdir/data/test$testno"); my @data = getpart("reply", "data"); diff --git a/tests/runtests.pl b/tests/runtests.pl index 944418d..c0de463 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -489,6 +489,7 @@ sub runftpserver { # now (re-)start our server: my $flag=$debugprotocol?"-v ":""; + $flag .= "-s \"$srcdir\""; my $cmd="$perl $srcdir/ftpserver.pl $flag $FTPPORT &"; if($verbose) { print "CMD: $cmd\n"; -- 2.7.4