summaryrefslogtreecommitdiff
path: root/debian/run-tests
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/run-tests
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/run-tests')
-rwxr-xr-xdebian/run-tests39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/run-tests b/debian/run-tests
new file mode 100755
index 000000000..7c7a8b2a3
--- /dev/null
+++ b/debian/run-tests
@@ -0,0 +1,39 @@
1#! /bin/sh
2# Run installed OpenSSH regression tests.
3
4tmp="$1"
5if [ -z "$tmp" ]; then
6 tmp="$(mktemp -d)"
7 cleanup () {
8 rm -rf "$tmp"
9 }
10 trap cleanup EXIT
11fi
12
13# Copy the regression tests to a fresh directory; this is easier than trying
14# to pick apart which ones need write access.
15cp -a /usr/lib/openssh/regress "$tmp/regress"
16
17ret=0
18make -C "$tmp/regress" \
19 .OBJDIR="$tmp/regress" \
20 .CURDIR="$tmp/regress" \
21 BUILDDIR="$tmp/regress" \
22 OBJ="$tmp/regress" \
23 SUDO=sudo \
24 TEST_SHELL=sh \
25 TEST_SSH_SFTPSERVER=/usr/lib/openssh/sftp-server \
26 TEST_SSH_PLINK=plink \
27 TEST_SSH_PUTTYGEN=puttygen \
28 TEST_SSH_CONCH=conch \
29 TEST_SSH_IPV6=yes \
30 TEST_SSH_ECC=yes \
31 tests interop-tests </dev/zero || ret="$?"
32if [ "$ret" -ne 0 ]; then
33 for log in failed-regress.log failed-ssh.log failed-sshd.log; do
34 if [ -e "$tmp/regress/$log" ]; then
35 tail -v -n+0 "$tmp/regress/$log"
36 fi
37 done
38fi
39exit "$ret"