]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/regress/reexec.sh
Upgrade to OpenSSH 7.6p1. This will be followed shortly by 7.7p1.
[FreeBSD/FreeBSD.git] / crypto / openssh / regress / reexec.sh
1 #       $OpenBSD: reexec.sh,v 1.12 2017/08/07 03:52:55 dtucker Exp $
2 #       Placed in the Public Domain.
3
4 tid="reexec tests"
5
6 SSHD_ORIG=$SSHD
7 SSHD_COPY=$OBJ/sshd
8
9 # Start a sshd and then delete it
10 start_sshd_copy ()
11 {
12         cp $SSHD_ORIG $SSHD_COPY
13         SSHD=$SSHD_COPY
14         start_sshd
15         SSHD=$SSHD_ORIG
16 }
17
18 # Do basic copy tests
19 copy_tests ()
20 {
21         rm -f ${COPY}
22         ${SSH} -nq -F $OBJ/ssh_config somehost \
23             cat ${DATA} > ${COPY}
24         if [ $? -ne 0 ]; then
25                 fail "ssh cat $DATA failed"
26         fi
27         cmp ${DATA} ${COPY}             || fail "corrupted copy"
28         rm -f ${COPY}
29 }
30
31 verbose "test config passing"
32
33 cp $OBJ/sshd_config $OBJ/sshd_config.orig
34 start_sshd
35 echo "InvalidXXX=no" >> $OBJ/sshd_config
36
37 copy_tests
38
39 stop_sshd
40
41 cp $OBJ/sshd_config.orig $OBJ/sshd_config
42
43 # cygwin can't fork a deleted binary
44 if [ "$os" != "cygwin" ]; then
45
46 verbose "test reexec fallback"
47
48 start_sshd_copy
49 rm -f $SSHD_COPY
50
51 copy_tests
52
53 stop_sshd
54 fi