diff options
author | des <des@FreeBSD.org> | 2003-04-23 16:53:02 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-04-23 16:53:02 +0000 |
commit | 85b37b9574631df0f7e774dda373514195c74b29 (patch) | |
tree | 70033bf9d0551c1f485a8bf5c04d41148812e33a /crypto/openssh/regress/agent-timeout.sh | |
parent | 099d1a58f7bc088a9f71af6d32542ca3949468a3 (diff) | |
download | FreeBSD-src-85b37b9574631df0f7e774dda373514195c74b29.zip FreeBSD-src-85b37b9574631df0f7e774dda373514195c74b29.tar.gz |
Vendor import of OpenSSH-portable 3.6.1p1.
Diffstat (limited to 'crypto/openssh/regress/agent-timeout.sh')
-rw-r--r-- | crypto/openssh/regress/agent-timeout.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/openssh/regress/agent-timeout.sh b/crypto/openssh/regress/agent-timeout.sh new file mode 100644 index 0000000..28b1be0 --- /dev/null +++ b/crypto/openssh/regress/agent-timeout.sh @@ -0,0 +1,36 @@ +# $OpenBSD: agent-timeout.sh,v 1.1 2002/06/06 00:38:40 markus Exp $ +# Placed in the Public Domain. + +tid="agent timeout test" + +TIMEOUT=5 + +trace "start agent" +eval `${SSHAGENT} -s` > /dev/null +r=$? +if [ $r -ne 0 ]; then + fail "could not start ssh-agent: exit code $r" +else + trace "add keys with timeout" + for t in rsa rsa1; do + ${SSHADD} -t ${TIMEOUT} $OBJ/$t > /dev/null 2>&1 + if [ $? -ne 0 ]; then + fail "ssh-add did succeed exit code 0" + fi + done + n=`${SSHADD} -l 2> /dev/null | wc -l` + trace "agent has $n keys" + if [ $n -ne 2 ]; then + fail "ssh-add -l did not return 2 keys: $n" + fi + trace "sleeping 2*${TIMEOUT} seconds" + sleep ${TIMEOUT} + sleep ${TIMEOUT} + ${SSHADD} -l 2> /dev/null | grep -q 'The agent has no identities.' + if [ $? -ne 0 ]; then + fail "ssh-add -l still returns keys after timeout" + fi + + trace "kill agent" + ${SSHAGENT} -k > /dev/null +fi |