]> granicus.if.org Git - curl/commitdiff
test harness: fix detection of test harness client knownhosts file
authorYang Tse <yangsita@gmail.com>
Wed, 31 Aug 2011 17:59:26 +0000 (19:59 +0200)
committerYang Tse <yangsita@gmail.com>
Wed, 31 Aug 2011 17:59:26 +0000 (19:59 +0200)
Regenerate curl's tests client knownhosts file also when, somehow,
this file is empty.

tests/sshserver.pl

index 5fda35fa52c6761a83a29f5a79fdcce18a40a973..8bb8bcdcf4939f25f02612ce5f3a15d7b13b9a79 100755 (executable)
@@ -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)) {