aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-02-10 02:52:17 +0000
committerYang Tse <yangsita@gmail.com>2008-02-10 02:52:17 +0000
commit6942d313ffa476a60a3a08aee13df56310a92c5a (patch)
tree47a98bd30c3c191d12b5592d8cf055cb44927bcb /tests
parent940c075bd8608e3e00a7f0e7d9792bd410dc7293 (diff)
Verify only once test harness sftp server connectivity and functionality.
Make sure that the sftp client tool uses the ssh client binary that we have used to generate the configuration files, otherwise sftp might be using one located in the preferred path compiled into sftp.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index b0520dbff..633485577 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -702,9 +702,15 @@ sub verifysftp {
logmsg "RUN: SFTP server cannot find $sftpexe\n";
return -1;
}
+ # Find out ssh client canonical file name
+ my $ssh = find_ssh();
+ if(!$ssh) {
+ logmsg "RUN: SFTP server cannot find $sshexe\n";
+ return -1;
+ }
# Connect to sftp server, authenticate and run a remote pwd
# command using our generated configuration and key files
- my $cmd = "$sftp -b $sftpcmds -F $sftpconfig $ip > $sftplog 2>&1";
+ my $cmd = "$sftp -b $sftpcmds -F $sftpconfig -S $ssh $ip > $sftplog 2>&1";
my $res = runclient($cmd);
# Search for pwd command response in log file
if(open(SFTPLOGFILE, "<$sftplog")) {
@@ -756,7 +762,6 @@ my %protofunc = ('http' => \&verifyhttp,
'ftps' => \&verifyftp,
'tftp' => \&verifyftp,
'ssh' => \&verifyssh,
- 'sftp' => \&verifysftp,
'socks' => \&verifysocks);
sub verifyserver {
@@ -1179,9 +1184,9 @@ sub runsshserver {
# once it is known that the ssh server is alive, sftp server verification
# is performed actually connecting to it, authenticating and performing a
- # very simple remote command.
+ # very simple remote command. This verification is tried only one time.
- if(!verifyserver("sftp",$ip,$port)) {
+ if(verifysftp("sftp",$ip,$port) < 1) {
logmsg "RUN: SFTP server failed verification\n";
# failed to talk to it properly. Kill the server and return failure
display_sftplog();