diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2013-03-23 11:09:44 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2013-03-23 11:09:44 +0000 |
commit | 89b937767c9639b94c82b43ecf8f453728047835 (patch) | |
tree | 7e7818820a50bdd08b2b718c3e94d8a4c4095b92 /regress/usr.bin | |
parent | 999c0f608ac8f9bad7f68de8a0d48d9cfe88464c (diff) |
Only regenerate host keys if they don't exist or if ssh-keygen has changed
since they were. Reduces test runtime by 5-30% depending on machine
speed.
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/ssh/test-exec.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index 4c7c6e65765..7d6ac718116 100644 --- a/regress/usr.bin/ssh/test-exec.sh +++ b/regress/usr.bin/ssh/test-exec.sh @@ -1,4 +1,4 @@ -# $OpenBSD: test-exec.sh,v 1.37 2010/02/24 06:21:56 djm Exp $ +# $OpenBSD: test-exec.sh,v 1.38 2013/03/23 11:09:43 dtucker Exp $ # Placed in the Public Domain. USER=`id -un` @@ -223,9 +223,11 @@ rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER trace "generate keys" for t in rsa rsa1; do # generate user key - rm -f $OBJ/$t - ${SSHKEYGEN} -q -N '' -t $t -f $OBJ/$t ||\ - fail "ssh-keygen for $t failed" + if [ ! -f $OBJ/$t ] || [ ${SSHKEYGEN} -nt $OBJ/$t ]; then + rm -f $OBJ/$t + ${SSHKEYGEN} -q -N '' -t $t -f $OBJ/$t ||\ + fail "ssh-keygen for $t failed" + fi # known hosts file for client ( |