diff options
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 10 | ||||
-rwxr-xr-x | debian/tests/regress | 64 |
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 @@ | |||
1 | Tests: regress | ||
2 | Restrictions: needs-root allow-stderr | ||
3 | Depends: 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 | ||
2 | set -e | ||
3 | |||
4 | if [ "$(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 | ||
18 | openssh-tests ALL = (ALL:ALL) NOPASSWD: ALL | ||
19 | EOF | ||
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 "$?" | ||
25 | fi | ||
26 | |||
27 | # Don't use "make tests"; we want to test the installed version. | ||
28 | |||
29 | cp -a . "$TMP/tree" | ||
30 | cd "$TMP/tree" | ||
31 | |||
32 | # Attempt to hack around test failure in some environments. | ||
33 | sed -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. | ||
37 | autoreconf -f -i | ||
38 | cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./ | ||
39 | ./configure | ||
40 | make | ||
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. | ||
46 | make regress-prep | ||
47 | make regress-binaries | ||
48 | |||
49 | SRCDIR="$(pwd)" | ||
50 | BUILDDIR="$SRCDIR" | ||
51 | make -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 | ||