diff options
author | Colin Watson <cjwatson@debian.org> | 2018-11-05 23:20:28 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-11-05 23:20:29 +0000 |
commit | b6760514d86206ce810da5f8895f3c364b047515 (patch) | |
tree | a560e672484de8661bc961eacaea2e0b64d92a8f /debian | |
parent | d41b9922e63e5069991d0e28079d710637715149 (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')
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | debian/control | 16 | ||||
-rw-r--r-- | debian/openssh-tests.install | 5 | ||||
-rwxr-xr-x | debian/rules | 4 | ||||
-rwxr-xr-x | debian/run-tests | 39 | ||||
-rw-r--r-- | debian/tests/control | 8 | ||||
-rwxr-xr-x | debian/tests/regress | 52 |
7 files changed, 70 insertions, 57 deletions
diff --git a/debian/changelog b/debian/changelog index f4a1870d1..4b97e0d1d 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -4,6 +4,9 @@ openssh (1:7.9p1-2) UNRELEASED; urgency=medium | |||
4 | * Make the autopkgtest create /run/sshd if it doesn't already exist. | 4 | * Make the autopkgtest create /run/sshd if it doesn't already exist. |
5 | * Drop "set -x" verbosity from the autopkgtest; I think we can do without | 5 | * Drop "set -x" verbosity from the autopkgtest; I think we can do without |
6 | this in most cases nowadays. | 6 | this in most cases nowadays. |
7 | * Add an openssh-tests binary package containing enough files to run the | ||
8 | upstream regression tests. This allows autopkgtest to run more | ||
9 | efficiently, as it doesn't have to build part of the source tree again. | ||
7 | 10 | ||
8 | -- Colin Watson <cjwatson@debian.org> Sat, 03 Nov 2018 16:28:16 +0000 | 11 | -- Colin Watson <cjwatson@debian.org> Sat, 03 Nov 2018 16:28:16 +0000 |
9 | 12 | ||
diff --git a/debian/control b/debian/control index 425d9ccf7..b91897ea9 100644 --- a/debian/control +++ b/debian/control | |||
@@ -153,6 +153,22 @@ Description: secure shell (SSH) sftp server module, for SFTP access from remote | |||
153 | Newer versions of the draft will not be supported, though some features | 153 | Newer versions of the draft will not be supported, though some features |
154 | are individually implemented as extensions. | 154 | are individually implemented as extensions. |
155 | 155 | ||
156 | Package: openssh-tests | ||
157 | Priority: optional | ||
158 | Architecture: any | ||
159 | Depends: openssh-client (= ${binary:Version}), | ||
160 | openssh-server (= ${binary:Version}), | ||
161 | openssh-sftp-server (= ${binary:Version}), | ||
162 | openssl, | ||
163 | putty-tools (>= 0.67-2), | ||
164 | python-twisted-conch (>= 1:15.5.0-1), | ||
165 | ${misc:Depends}, | ||
166 | ${shlibs:Depends}, | ||
167 | Description: OpenSSH regression tests | ||
168 | This package provides OpenSSH's regression test suite. It is mainly | ||
169 | intended for use with the autopkgtest system, though can also be run | ||
170 | directly using /usr/lib/openssh/regress/run-tests. | ||
171 | |||
156 | Package: ssh | 172 | Package: ssh |
157 | Priority: optional | 173 | Priority: optional |
158 | Architecture: all | 174 | Architecture: all |
diff --git a/debian/openssh-tests.install b/debian/openssh-tests.install new file mode 100644 index 000000000..7c24e558f --- /dev/null +++ b/debian/openssh-tests.install | |||
@@ -0,0 +1,5 @@ | |||
1 | regress /usr/lib/openssh | ||
2 | debian/build-deb/regress /usr/lib/openssh | ||
3 | |||
4 | debian/build-deb/config.h /usr/lib/openssh/regress | ||
5 | debian/run-tests /usr/lib/openssh/regress | ||
diff --git a/debian/rules b/debian/rules index a41241079..24f1683dc 100755 --- a/debian/rules +++ b/debian/rules | |||
@@ -130,6 +130,8 @@ override_dh_auto_configure-indep: | |||
130 | 130 | ||
131 | override_dh_auto_build-arch: | 131 | override_dh_auto_build-arch: |
132 | $(MAKE) -C debian/build-deb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' | 132 | $(MAKE) -C debian/build-deb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' |
133 | $(MAKE) -C debian/build-deb regress-prep | ||
134 | $(MAKE) -C debian/build-deb $(PARALLEL) regress-binaries | ||
133 | ifeq ($(filter noudeb,$(DEB_BUILD_PROFILES)),) | 135 | ifeq ($(filter noudeb,$(DEB_BUILD_PROFILES)),) |
134 | $(MAKE) -C debian/build-udeb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen | 136 | $(MAKE) -C debian/build-udeb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen |
135 | endif | 137 | endif |
@@ -142,8 +144,6 @@ override_dh_auto_build-indep: | |||
142 | 144 | ||
143 | override_dh_auto_test-arch: | 145 | override_dh_auto_test-arch: |
144 | ifeq ($(RUN_TESTS),yes) | 146 | ifeq ($(RUN_TESTS),yes) |
145 | $(MAKE) -C debian/build-deb regress-prep | ||
146 | $(MAKE) -C debian/build-deb $(PARALLEL) regress-binaries | ||
147 | $(MAKE) -C debian/build-deb/regress \ | 147 | $(MAKE) -C debian/build-deb/regress \ |
148 | .OBJDIR="$(CURDIR)/debian/build-deb/regress" \ | 148 | .OBJDIR="$(CURDIR)/debian/build-deb/regress" \ |
149 | .CURDIR="$(CURDIR)/regress" \ | 149 | .CURDIR="$(CURDIR)/regress" \ |
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 | |||
4 | tmp="$1" | ||
5 | if [ -z "$tmp" ]; then | ||
6 | tmp="$(mktemp -d)" | ||
7 | cleanup () { | ||
8 | rm -rf "$tmp" | ||
9 | } | ||
10 | trap cleanup EXIT | ||
11 | fi | ||
12 | |||
13 | # Copy the regression tests to a fresh directory; this is easier than trying | ||
14 | # to pick apart which ones need write access. | ||
15 | cp -a /usr/lib/openssh/regress "$tmp/regress" | ||
16 | |||
17 | ret=0 | ||
18 | make -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="$?" | ||
32 | if [ "$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 | ||
38 | fi | ||
39 | exit "$ret" | ||
diff --git a/debian/tests/control b/debian/tests/control index ba59c97b4..85220df4e 100644 --- a/debian/tests/control +++ b/debian/tests/control | |||
@@ -2,12 +2,6 @@ Tests: regress | |||
2 | Restrictions: needs-root allow-stderr | 2 | Restrictions: needs-root allow-stderr |
3 | Depends: devscripts, | 3 | Depends: devscripts, |
4 | haveged, | 4 | haveged, |
5 | openssh-client, | 5 | openssh-tests, |
6 | openssh-server, | ||
7 | openssh-sftp-server, | ||
8 | openssl, | ||
9 | putty-tools (>= 0.67-2), | ||
10 | python-twisted-conch (>= 1:15.5.0-1), | ||
11 | sudo, | 6 | sudo, |
12 | sysvinit-utils, | 7 | sysvinit-utils, |
13 | @builddeps@, | ||
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 | |||
37 | EOF | 36 | EOF |
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 "$?" |
66 | fi | 64 | fi |
67 | 65 | ||
68 | # Don't use "make tests"; we want to test the installed version. | 66 | annotate-output +%H:%M:%S.%N /usr/lib/openssh/regress/run-tests "$TMP" |
69 | |||
70 | cd "$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. | ||
74 | autoreconf -f -i | ||
75 | cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./ | ||
76 | ./configure | ||
77 | make | ||
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. | ||
83 | make regress-prep | ||
84 | make regress-binaries | ||
85 | |||
86 | SRCDIR="$(pwd)" | ||
87 | BUILDDIR="$SRCDIR" | ||
88 | ret=0 | ||
89 | annotate-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="$?" | ||
103 | if [ "$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 | ||
109 | fi | ||
110 | exit "$ret" | ||