[openssh-commits] [openssh] 02/05: upstream: Add regress test for SIGHUP restart

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Jun 10 20:53:29 AEST 2021


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 9d0892153c005cc65897e9372b01fa66fcbe2842
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Thu Jun 10 03:45:31 2021 +0000

    upstream: Add regress test for SIGHUP restart
    
    while handling active and unauthenticated clients.  Should catch anything
    similar to the pselect bug just fixed in sshd.c.
    
    OpenBSD-Regress-ID: 3b3c19b5e75e43af1ebcb9586875b3ae3a4cac73
---
 regress/reconfigure.sh | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/regress/reconfigure.sh b/regress/reconfigure.sh
index dd15eddb..e0d60375 100644
--- a/regress/reconfigure.sh
+++ b/regress/reconfigure.sh
@@ -1,4 +1,4 @@
-#	$OpenBSD: reconfigure.sh,v 1.6 2017/04/30 23:34:55 djm Exp $
+#	$OpenBSD: reconfigure.sh,v 1.7 2021/06/10 03:45:31 dtucker Exp $
 #	Placed in the Public Domain.
 
 tid="simple connect after reconfigure"
@@ -41,3 +41,25 @@ ${SSH} -F $OBJ/ssh_config somehost true
 if [ $? -ne 0 ]; then
 	fail "ssh connect with failed after reconfigure"
 fi
+
+trace "reconfigure with active clients"
+${SSH} -F $OBJ/ssh_config somehost sleep 10  # authenticated client
+${NC} -d 127.0.0.1 $PORT >/dev/null &  # unauthenticated client
+PID=`cat $PIDFILE`
+rm -f $PIDFILE
+$SUDO kill -HUP $PID
+
+trace "wait for sshd to restart"
+i=0;
+while [ ! -f $PIDFILE -a $i -lt 10 ]; do
+	i=`expr $i + 1`
+	sleep $i
+done
+
+test -f $PIDFILE || fatal "sshd did not restart"
+
+trace "connect after restart with active clients"
+${SSH} -F $OBJ/ssh_config somehost true
+if [ $? -ne 0 ]; then
+	fail "ssh connect with failed after reconfigure"
+fi

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list