1 # $OpenBSD: agent-timeout.sh,v 1.1 2002/06/06 00:38:40 markus Exp $
2 # Placed in the Public Domain.
4 tid
="agent timeout test"
9 eval `${SSHAGENT} -s` > /dev
/null
12 fail
"could not start ssh-agent: exit code $r"
14 trace
"add keys with timeout"
16 ${SSHADD} -t ${SSHAGENT_TIMEOUT} $OBJ/$t > /dev
/null
2>&1
18 fail
"ssh-add did succeed exit code 0"
21 n
=`${SSHADD} -l 2> /dev/null | wc -l`
22 trace
"agent has $n keys"
24 fail
"ssh-add -l did not return 2 keys: $n"
26 trace
"sleeping 2*${SSHAGENT_TIMEOUT} seconds"
27 sleep ${SSHAGENT_TIMEOUT}
28 sleep ${SSHAGENT_TIMEOUT}
29 ${SSHADD} -l 2> /dev
/null |
grep 'The agent has no identities.' >/dev
/null
31 fail
"ssh-add -l still returns keys after timeout"
35 ${SSHAGENT} -k > /dev
/null