summaryrefslogtreecommitdiff
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control10
-rwxr-xr-xdebian/tests/regress64
2 files changed, 74 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 000000000..62264efd5
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,10 @@
1Tests: regress
2Restrictions: needs-root allow-stderr
3Depends: openssh-client,
4 openssh-server,
5 openssh-sftp-server,
6 openssl,
7 putty-tools (>= 0.67-2),
8 python-twisted-conch (>= 1:15.5.0-1),
9 sudo,
10 @builddeps@,
diff --git a/debian/tests/regress b/debian/tests/regress
new file mode 100755
index 000000000..02b8658bd
--- /dev/null
+++ b/debian/tests/regress
@@ -0,0 +1,64 @@
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 chown openssh-tests:openssh-tests "$TMP"
23 sudo -u openssh-tests env TMP="$TMP" "$0" "$@"
24 exit "$?"
25fi
26
27# Don't use "make tests"; we want to test the installed version.
28
29cp -a . "$TMP/tree"
30cd "$TMP/tree"
31
32# Attempt to hack around test failure in some environments.
33sed -i 's/^base=33/base=34/' regress/forwarding.sh
34
35# We aren't actually going to use most of this build, but we need a basic
36# build tree in place in order to be able to build the regression tests.
37autoreconf -f -i
38cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./
39./configure
40make
41
42# The defaults for TEST_SSH_* in regress/test-exec.sh use the system
43# versions, but the top-level Makefile sets things up to test the just-built
44# versions, so we must bypass the latter in order to work correctly under
45# autopkgtest.
46make regress-prep
47make regress-binaries
48
49SRCDIR="$(pwd)"
50BUILDDIR="$SRCDIR"
51make -C regress \
52 .OBJDIR="$BUILDDIR/regress" \
53 .CURDIR="$SRCDIR/regress" \
54 BUILDDIR="$BUILDDIR" \
55 OBJ="$BUILDDIR/regress" \
56 SUDO=sudo \
57 TEST_SHELL=sh \
58 TEST_SSH_SFTPSERVER=/usr/lib/openssh/sftp-server \
59 TEST_SSH_PLINK=plink \
60 TEST_SSH_PUTTYGEN=puttygen \
61 TEST_SSH_CONCH=conch \
62 TEST_SSH_IPV6=yes \
63 TEST_SSH_ECC=yes \
64 tests interop-tests </dev/zero