]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/regress/reconfigure.sh
ena: Upgrade ena-com to freebsd v2.7.0
[FreeBSD/FreeBSD.git] / crypto / openssh / regress / reconfigure.sh
1 #       $OpenBSD: reconfigure.sh,v 1.9 2021/06/10 09:46:28 dtucker Exp $
2 #       Placed in the Public Domain.
3
4 tid="simple connect after reconfigure"
5
6 # we need the full path to sshd for -HUP
7 if test "x$USE_VALGRIND" = "x" ; then
8         case $SSHD in
9         /*)
10                 # full path is OK
11                 ;;
12         *)
13                 # otherwise make fully qualified
14                 SSHD=$OBJ/$SSHD
15         esac
16 fi
17
18 start_sshd
19
20 trace "connect before restart"
21 ${SSH} -F $OBJ/ssh_config somehost true
22 if [ $? -ne 0 ]; then
23         fail "ssh connect with failed before reconfigure"
24 fi
25
26 PID=`$SUDO cat $PIDFILE`
27 rm -f $PIDFILE
28 $SUDO kill -HUP $PID
29
30 trace "wait for sshd to restart"
31 i=0;
32 while [ ! -f $PIDFILE -a $i -lt 10 ]; do
33         i=`expr $i + 1`
34         sleep $i
35 done
36
37 test -f $PIDFILE || fatal "sshd did not restart"
38
39 trace "connect after restart"
40 ${SSH} -F $OBJ/ssh_config somehost true
41 if [ $? -ne 0 ]; then
42         fail "ssh connect with failed after reconfigure"
43 fi
44
45 trace "reconfigure with active clients"
46 ${SSH} -F $OBJ/ssh_config somehost sleep 10  # authenticated client
47 ${NC} -d 127.0.0.1 $PORT >/dev/null &  # unauthenticated client
48 PID=`$SUDO cat $PIDFILE`
49 rm -f $PIDFILE
50 $SUDO kill -HUP $PID
51
52 trace "wait for sshd to restart"
53 i=0;
54 while [ ! -f $PIDFILE -a $i -lt 10 ]; do
55         i=`expr $i + 1`
56         sleep $i
57 done
58
59 test -f $PIDFILE || fatal "sshd did not restart"
60
61 trace "connect after restart with active clients"
62 ${SSH} -F $OBJ/ssh_config somehost true
63 if [ $? -ne 0 ]; then
64         fail "ssh connect with failed after reconfigure"
65 fi