summaryrefslogtreecommitdiff
path: root/debian/tests/regress
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-11-05 23:20:28 +0000
committerColin Watson <cjwatson@debian.org>2018-11-05 23:20:29 +0000
commitb6760514d86206ce810da5f8895f3c364b047515 (patch)
treea560e672484de8661bc961eacaea2e0b64d92a8f /debian/tests/regress
parentd41b9922e63e5069991d0e28079d710637715149 (diff)
Add an openssh-tests binary package
This contains enough files to run the upstream regression tests. Doing this allows autopkgtest to run more efficiently, as it doesn't have to build part of the source tree again.
Diffstat (limited to 'debian/tests/regress')
-rwxr-xr-xdebian/tests/regress52
1 files changed, 4 insertions, 48 deletions
diff --git a/debian/tests/regress b/debian/tests/regress
index 6c2a8daec..8bb73ee95 100755
--- a/debian/tests/regress
+++ b/debian/tests/regress
@@ -15,11 +15,10 @@ if [ "$(id -un)" != openssh-tests ]; then
15 else 15 else
16 start-stop-daemon --stop --quiet \ 16 start-stop-daemon --stop --quiet \
17 --retry=TERM/30/KILL/5 \ 17 --retry=TERM/30/KILL/5 \
18 --pidfile "$TMP/haveged.pid" \ 18 --pidfile "$ADTTMP/haveged.pid" \
19 --name haveged 19 --name haveged
20 fi 20 fi
21 fi 21 fi
22 rm -rf "$TMP"
23 rm -f /etc/sudoers.d/openssh-tests 22 rm -f /etc/sudoers.d/openssh-tests
24 if id openssh-tests >/dev/null 2>&1; then 23 if id openssh-tests >/dev/null 2>&1; then
25 deluser --remove-home openssh-tests 24 deluser --remove-home openssh-tests
@@ -37,7 +36,6 @@ openssh-tests ALL = (ALL:ALL) NOPASSWD: ALL
37EOF 36EOF
38 chmod 440 /etc/sudoers.d/openssh-tests 37 chmod 440 /etc/sudoers.d/openssh-tests
39 mkdir -p "$TMP" 38 mkdir -p "$TMP"
40 cp -a . "$TMP/tree"
41 chown -R openssh-tests:openssh-tests "$TMP" 39 chown -R openssh-tests:openssh-tests "$TMP"
42 40
43 # Depending on how the environment is configured, our test 41 # Depending on how the environment is configured, our test
@@ -56,8 +54,8 @@ EOF
56 STARTED_HAVEGED=: 54 STARTED_HAVEGED=:
57 elif ! pidof haveged >/dev/null; then 55 elif ! pidof haveged >/dev/null; then
58 start-stop-daemon --start --quiet \ 56 start-stop-daemon --start --quiet \
59 --pidfile "$TMP/haveged.pid" \ 57 --pidfile "$ADTTMP/haveged.pid" \
60 --exec /usr/sbin/haveged -- -p "$TMP/haveged.pid" 58 --exec /usr/sbin/haveged -- -p "$ADTTMP/haveged.pid"
61 STARTED_HAVEGED=: 59 STARTED_HAVEGED=:
62 fi 60 fi
63 61
@@ -65,46 +63,4 @@ EOF
65 exit "$?" 63 exit "$?"
66fi 64fi
67 65
68# Don't use "make tests"; we want to test the installed version. 66annotate-output +%H:%M:%S.%N /usr/lib/openssh/regress/run-tests "$TMP"
69
70cd "$TMP/tree"
71
72# We aren't actually going to use most of this build, but we need a basic
73# build tree in place in order to be able to build the regression tests.
74autoreconf -f -i
75cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./
76./configure
77make
78
79# The defaults for TEST_SSH_* in regress/test-exec.sh use the system
80# versions, but the top-level Makefile sets things up to test the just-built
81# versions, so we must bypass the latter in order to work correctly under
82# autopkgtest.
83make regress-prep
84make regress-binaries
85
86SRCDIR="$(pwd)"
87BUILDDIR="$SRCDIR"
88ret=0
89annotate-output +%H:%M:%S.%N make -C regress \
90 .OBJDIR="$BUILDDIR/regress" \
91 .CURDIR="$SRCDIR/regress" \
92 BUILDDIR="$BUILDDIR" \
93 OBJ="$BUILDDIR/regress" \
94 SUDO=sudo \
95 TEST_SHELL=sh \
96 TEST_SSH_SFTPSERVER=/usr/lib/openssh/sftp-server \
97 TEST_SSH_PLINK=plink \
98 TEST_SSH_PUTTYGEN=puttygen \
99 TEST_SSH_CONCH=conch \
100 TEST_SSH_IPV6=yes \
101 TEST_SSH_ECC=yes \
102 tests interop-tests </dev/zero || ret="$?"
103if [ "$ret" -ne 0 ]; then
104 for log in failed-regress.log failed-ssh.log failed-sshd.log; do
105 if [ -e "$BUILDDIR/regress/$log" ]; then
106 tail -v -n+0 "$BUILDDIR/regress/$log"
107 fi
108 done
109fi
110exit "$ret"