To verify that the sftp server is actually running, responsive and that

all curl's tests generated configuration and key files are fine, a real
connection is established to the test harness sftp server authenticating
and running a simple sftp remote pwd command.

The verification is done using OpenSSH's or SunSSH's sftp client tool with
a configuration file with the same options as the test harness socks server
with the exception that dynamic forwarding is not used for sftp.
This commit is contained in:
Yang Tse 2008-02-08 13:54:02 +00:00
parent 05c191199d
commit 1a340de0e5
5 changed files with 176 additions and 12 deletions

View file

@ -37,13 +37,17 @@ use vars qw(
@EXPORT_OK
$sshdexe
$sshexe
$sftpsrvexe
$sftpexe
$sshkeygenexe
$sshdconfig
$sshconfig
$sftpconfig
$knownhosts
$sshdlog
$sshlog
$sftplog
$sftpcmds
$hstprvkeyf
$hstpubkeyf
$cliprvkeyf
@ -64,24 +68,31 @@ use vars qw(
@EXPORT_OK = qw(
$sshdexe
$sshexe
$sftpsrvexe
$sftpexe
$sshkeygenexe
$sshdconfig
$sshconfig
$sftpconfig
$knownhosts
$sshdlog
$sshlog
$sftplog
$sftpcmds
$hstprvkeyf
$hstpubkeyf
$cliprvkeyf
$clipubkeyf
display_sshdconfig
display_sshconfig
display_sftpconfig
display_sshdlog
display_sshlog
display_sftplog
dump_array
find_sshd
find_ssh
find_sftpsrv
find_sftp
find_sshkeygen
logmsg
@ -94,12 +105,16 @@ use vars qw(
#
$sshdexe = 'sshd' .exe_ext(); # base name and ext of ssh daemon
$sshexe = 'ssh' .exe_ext(); # base name and ext of ssh client
$sftpexe = 'sftp-server' .exe_ext(); # base name and ext of sftp-server
$sftpsrvexe = 'sftp-server' .exe_ext(); # base name and ext of sftp-server
$sftpexe = 'sftp' .exe_ext(); # base name and ext of sftp client
$sshkeygenexe = 'ssh-keygen' .exe_ext(); # base name and ext of ssh-keygen
$sshdconfig = 'curl_sshd_config'; # ssh daemon config file
$sshconfig = 'curl_ssh_config'; # ssh client config file
$sftpconfig = 'curl_sftp_config'; # sftp client config file
$sshdlog = 'log/sshd.log'; # ssh daemon log file
$sshlog = 'log/ssh.log'; # ssh client log file
$sftplog = 'log/sftp.log'; # sftp client log file
$sftpcmds = 'curl_sftp_cmds'; # sftp client commands batch file
$knownhosts = 'curl_client_knownhosts'; # ssh knownhosts file
$hstprvkeyf = 'curl_host_dsa_key'; # host private key file
$hstpubkeyf = 'curl_host_dsa_key.pub'; # host public key file
@ -213,6 +228,14 @@ sub display_sshconfig {
}
#***************************************************************************
# Display contents of the sftp client config file
#
sub display_sftpconfig {
display_file($sftpconfig);
}
#***************************************************************************
# Display contents of the ssh daemon log file
#
@ -229,6 +252,14 @@ sub display_sshlog {
}
#***************************************************************************
# Display contents of the sftp client log file
#
sub display_sftplog {
display_file($sftplog);
}
#***************************************************************************
# Find a file somewhere in the given path
#
@ -276,6 +307,14 @@ sub find_ssh {
#***************************************************************************
# Find sftp-server plugin and return canonical filename
#
sub find_sftpsrv {
return find_sfile($sftpsrvexe);
}
#***************************************************************************
# Find sftp client and return canonical filename
#
sub find_sftp {
return find_sfile($sftpexe);
}