diff options
author | Colin Watson <cjwatson@debian.org> | 2003-09-01 18:42:19 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-09-01 18:42:19 +0000 |
commit | 8d6b7f4c46de3feb66f704ab483e51ea1a3bb0e1 (patch) | |
tree | 41fe3dd71501bbec5b0393f1536c925eaee180e9 /regress/agent-timeout.sh | |
parent | f045c69060bfdd5cf8759a5f29d7008d02e4de5b (diff) | |
parent | 58bfa257481a1c6938ada9bbd38801cc45633fb0 (diff) |
Debian release 3.6p1-1.
Diffstat (limited to 'regress/agent-timeout.sh')
-rw-r--r-- | regress/agent-timeout.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/regress/agent-timeout.sh b/regress/agent-timeout.sh new file mode 100644 index 000000000..28b1be028 --- /dev/null +++ b/regress/agent-timeout.sh | |||
@@ -0,0 +1,36 @@ | |||
1 | # $OpenBSD: agent-timeout.sh,v 1.1 2002/06/06 00:38:40 markus Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="agent timeout test" | ||
5 | |||
6 | TIMEOUT=5 | ||
7 | |||
8 | trace "start agent" | ||
9 | eval `${SSHAGENT} -s` > /dev/null | ||
10 | r=$? | ||
11 | if [ $r -ne 0 ]; then | ||
12 | fail "could not start ssh-agent: exit code $r" | ||
13 | else | ||
14 | trace "add keys with timeout" | ||
15 | for t in rsa rsa1; do | ||
16 | ${SSHADD} -t ${TIMEOUT} $OBJ/$t > /dev/null 2>&1 | ||
17 | if [ $? -ne 0 ]; then | ||
18 | fail "ssh-add did succeed exit code 0" | ||
19 | fi | ||
20 | done | ||
21 | n=`${SSHADD} -l 2> /dev/null | wc -l` | ||
22 | trace "agent has $n keys" | ||
23 | if [ $n -ne 2 ]; then | ||
24 | fail "ssh-add -l did not return 2 keys: $n" | ||
25 | fi | ||
26 | trace "sleeping 2*${TIMEOUT} seconds" | ||
27 | sleep ${TIMEOUT} | ||
28 | sleep ${TIMEOUT} | ||
29 | ${SSHADD} -l 2> /dev/null | grep -q 'The agent has no identities.' | ||
30 | if [ $? -ne 0 ]; then | ||
31 | fail "ssh-add -l still returns keys after timeout" | ||
32 | fi | ||
33 | |||
34 | trace "kill agent" | ||
35 | ${SSHAGENT} -k > /dev/null | ||
36 | fi | ||