aboutsummaryrefslogtreecommitdiff
path: root/tests/sshserver.pl
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-31 19:59:26 +0200
committerYang Tse <yangsita@gmail.com>2011-08-31 19:59:26 +0200
commit437848d75443aa1a189cb81dfaaad9f19d0cc60b (patch)
tree7828cab3ef82392669d76132d229322a1cc9eee7 /tests/sshserver.pl
parent38fff918f93408ed71e16bc8cdb5fd45251470bb (diff)
test harness: fix detection of test harness client knownhosts file
Regenerate curl's tests client knownhosts file also when, somehow, this file is empty.
Diffstat (limited to 'tests/sshserver.pl')
-rwxr-xr-xtests/sshserver.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
index 5fda35fa5..8bb8bcdcf 100755
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -708,8 +708,9 @@ if(system "$sshd -t -f $sshdconfig > $sshdlog 2>&1") {
#***************************************************************************
# Generate ssh client host key database file for curl's tests
#
-if(! -e $knownhosts) {
+if((! -e $knownhosts) || (! -s $knownhosts)) {
logmsg 'generating ssh client known hosts file...' if($verbose);
+ unlink($knownhosts);
if(open(DSAKEYFILE, "<$hstpubkeyf")) {
my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
if(close(DSAKEYFILE)) {