summaryrefslogtreecommitdiff
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control11
-rwxr-xr-xdebian/tests/regress70
2 files changed, 81 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 000000000..df8f9b847
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,11 @@
1Tests: regress
2Restrictions: needs-root allow-stderr
3Depends: devscripts,
4 openssh-client,
5 openssh-server,
6 openssh-sftp-server,
7 openssl,
8 putty-tools (>= 0.67-2),
9 python-twisted-conch (>= 1:15.5.0-1),
10 sudo,
11 @builddeps@,
diff --git a/debian/tests/regress b/debian/tests/regress
new file mode 100755
index 000000000..662526b54
--- /dev/null
+++ b/debian/tests/regress
@@ -0,0 +1,70 @@
1#! /bin/sh
2set -e
3
4if [ "$(id -un)" != openssh-tests ]; then
5 TMP="$ADTTMP/user"
6
7 cleanup () {
8 rm -rf "$TMP"
9 rm -f /etc/sudoers.d/openssh-tests
10 if id openssh-tests >/dev/null 2>&1; then
11 deluser --remove-home openssh-tests
12 fi
13 }
14 trap cleanup EXIT
15
16 adduser --disabled-password --gecos 'OpenSSH tests' openssh-tests
17 cat >/etc/sudoers.d/openssh-tests <<EOF
18openssh-tests ALL = (ALL:ALL) NOPASSWD: ALL
19EOF
20 chmod 440 /etc/sudoers.d/openssh-tests
21 mkdir -p "$TMP"
22 cp -a . "$TMP/tree"
23 chown -R openssh-tests:openssh-tests "$TMP"
24 sudo -u openssh-tests env TMP="$TMP" "$0" "$@"
25 exit "$?"
26fi
27
28# Don't use "make tests"; we want to test the installed version.
29
30cd "$TMP/tree"
31
32# We aren't actually going to use most of this build, but we need a basic
33# build tree in place in order to be able to build the regression tests.
34autoreconf -f -i
35cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./
36./configure
37make
38
39# The defaults for TEST_SSH_* in regress/test-exec.sh use the system
40# versions, but the top-level Makefile sets things up to test the just-built
41# versions, so we must bypass the latter in order to work correctly under
42# autopkgtest.
43make regress-prep
44make regress-binaries
45
46SRCDIR="$(pwd)"
47BUILDDIR="$SRCDIR"
48ret=0
49annotate-output +%H:%M:%S.%N make -C regress \
50 .OBJDIR="$BUILDDIR/regress" \
51 .CURDIR="$SRCDIR/regress" \
52 BUILDDIR="$BUILDDIR" \
53 OBJ="$BUILDDIR/regress" \
54 SUDO=sudo \
55 TEST_SHELL='sh -x' \
56 TEST_SSH_SFTPSERVER=/usr/lib/openssh/sftp-server \
57 TEST_SSH_PLINK=plink \
58 TEST_SSH_PUTTYGEN=puttygen \
59 TEST_SSH_CONCH=conch \
60 TEST_SSH_IPV6=yes \
61 TEST_SSH_ECC=yes \
62 tests interop-tests </dev/zero || ret="$?"
63if [ "$ret" -ne 0 ]; then
64 for log in failed-regress.log failed-ssh.log failed-sshd.log; do
65 if [ -e "$BUILDDIR/regress/$log" ]; then
66 tail -v -n+0 "$BUILDDIR/regress/$log"
67 fi
68 done
69fi
70exit "$ret"