summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2014-02-27 21:21:26 +0000
committerDamien Miller <djm@cvs.openbsd.org>2014-02-27 21:21:26 +0000
commite5d8214a982bcbc588bdb02810770004a9394e0a (patch)
tree73f2a2aacdc8f9b7e2bc90e60124e373134349c4 /regress/usr.bin
parent9e724fd859b8326ddb017a6dc1d1b58087a8ed28 (diff)
keep return values that are printed in error messages;
from portable
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/ssh/agent-ptrace.sh7
-rw-r--r--regress/usr.bin/ssh/agent.sh32
2 files changed, 23 insertions, 16 deletions
diff --git a/regress/usr.bin/ssh/agent-ptrace.sh b/regress/usr.bin/ssh/agent-ptrace.sh
index 9f9c99960ca..35a908b7c69 100644
--- a/regress/usr.bin/ssh/agent-ptrace.sh
+++ b/regress/usr.bin/ssh/agent-ptrace.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: agent-ptrace.sh,v 1.1 2002/12/09 15:38:30 markus Exp $
+# $OpenBSD: agent-ptrace.sh,v 1.2 2014/02/27 21:21:25 djm Exp $
# Placed in the Public Domain.
tid="disallow agent ptrace attach"
@@ -13,8 +13,9 @@ else
gdb ${SSHAGENT} ${SSH_AGENT_PID} > ${OBJ}/gdb.out 2>&1 << EOF
quit
EOF
- if [ $? -ne 0 ]; then
- fail "gdb failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "gdb failed: exit code $r"
fi
grep -q 'ptrace: Operation not permitted.' ${OBJ}/gdb.out
r=$?
diff --git a/regress/usr.bin/ssh/agent.sh b/regress/usr.bin/ssh/agent.sh
index 90bad15d433..caad3c88e4c 100644
--- a/regress/usr.bin/ssh/agent.sh
+++ b/regress/usr.bin/ssh/agent.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: agent.sh,v 1.9 2013/12/06 13:52:46 markus Exp $
+# $OpenBSD: agent.sh,v 1.10 2014/02/27 21:21:25 djm Exp $
# Placed in the Public Domain.
tid="simple agent test"
@@ -34,40 +34,46 @@ else
fi
done
${SSHADD} -l > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -l failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -l failed: exit code $r"
fi
# the same for full pubkey output
${SSHADD} -L > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -L failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -L failed: exit code $r"
fi
trace "simple connect via agent"
for p in 1 2; do
${SSH} -$p -F $OBJ/ssh_proxy somehost exit 5$p
- if [ $? -ne 5$p ]; then
- fail "ssh connect with protocol $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 5$p ]; then
+ fail "ssh connect with protocol $p failed (exit code $r)"
fi
done
trace "agent forwarding"
for p in 1 2; do
${SSH} -A -$p -F $OBJ/ssh_proxy somehost ${SSHADD} -l > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -l via agent fwd proto $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -l via agent fwd proto $p failed (exit code $r)"
fi
${SSH} -A -$p -F $OBJ/ssh_proxy somehost \
"${SSH} -$p -F $OBJ/ssh_proxy somehost exit 5$p"
- if [ $? -ne 5$p ]; then
- fail "agent fwd proto $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 5$p ]; then
+ fail "agent fwd proto $p failed (exit code $r)"
fi
done
trace "delete all agent keys"
${SSHADD} -D > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -D failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -D failed: exit code $r"
fi
trace "kill agent"