Re: Call for testing: OpenSSH-6.5

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hi,

regress/agent.sh reports wrong exit codes when some of tests fail:

run test agent.sh ...
agent fwd proto 1 failed (exit code 0)
agent fwd proto 2 failed (exit code 0)
failed simple agent test

It's probably due to using $? value in error message after
"if [ $? -ne 0 ]; then"
which sets $? to 0.

With the attached patch, the output would look like:
run test agent.sh ...
agent fwd proto 1 failed (exit code 255)
agent fwd proto 2 failed (exit code 255)
failed simple agent test


I noticed it when I'd run "make tests" by an user, who runs ssh-agent with a static socket from .bashrc:
eval `ssh-agent -a /tmp/plautrba/.ssh-agent.sock`

In this case, the agent.sh always fails, but I consider this more as a configuration issue than
a real bug in test suite.

However, with the standard .bashrc I can confirm that "make tests" passes on RHEL-7 Beta.

Thanks,

Petr
-- 
Petr Lautrbach
Security Technologies
Red Hat

Better technology. Faster innovation. Powered by community collaboration.
See how it works at redhat.com.
diff --git a/regress/agent.sh b/regress/agent.sh
index 90bad15..cf1a45f 100644
--- a/regress/agent.sh
+++ b/regress/agent.sh
@@ -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"

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux