diff options
author | Colin Watson <cjwatson@debian.org> | 2017-08-28 12:04:02 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-08-28 12:04:02 +0100 |
commit | e1c5c61f519b8ef0c210c7949789cfb33ad0cf13 (patch) | |
tree | 643a94eeb6515e7b27c159bb139b6f58f13d8954 /debian/tests | |
parent | 33e4d1c2c2833ece5bd22fc2ca982a9b7f8ad97f (diff) |
Run haveged during autopkgtests to ensure that they have enough entropy for key generation (LP: #1712921).
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 2 | ||||
-rwxr-xr-x | debian/tests/regress | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control index df8f9b847..ba59c97b4 100644 --- a/debian/tests/control +++ b/debian/tests/control | |||
@@ -1,6 +1,7 @@ | |||
1 | Tests: regress | 1 | Tests: regress |
2 | Restrictions: needs-root allow-stderr | 2 | Restrictions: needs-root allow-stderr |
3 | Depends: devscripts, | 3 | Depends: devscripts, |
4 | haveged, | ||
4 | openssh-client, | 5 | openssh-client, |
5 | openssh-server, | 6 | openssh-server, |
6 | openssh-sftp-server, | 7 | openssh-sftp-server, |
@@ -8,4 +9,5 @@ Depends: devscripts, | |||
8 | putty-tools (>= 0.67-2), | 9 | putty-tools (>= 0.67-2), |
9 | python-twisted-conch (>= 1:15.5.0-1), | 10 | python-twisted-conch (>= 1:15.5.0-1), |
10 | sudo, | 11 | sudo, |
12 | sysvinit-utils, | ||
11 | @builddeps@, | 13 | @builddeps@, |
diff --git a/debian/tests/regress b/debian/tests/regress index 662526b54..79405e198 100755 --- a/debian/tests/regress +++ b/debian/tests/regress | |||
@@ -5,6 +5,12 @@ if [ "$(id -un)" != openssh-tests ]; then | |||
5 | TMP="$ADTTMP/user" | 5 | TMP="$ADTTMP/user" |
6 | 6 | ||
7 | cleanup () { | 7 | cleanup () { |
8 | if [ -e "$TMP/haveged.pid" ]; then | ||
9 | start-stop-daemon --stop --quiet \ | ||
10 | --retry=TERM/30/KILL/5 \ | ||
11 | --pidfile "$TMP/haveged.pid" \ | ||
12 | --name haveged | ||
13 | fi | ||
8 | rm -rf "$TMP" | 14 | rm -rf "$TMP" |
9 | rm -f /etc/sudoers.d/openssh-tests | 15 | rm -f /etc/sudoers.d/openssh-tests |
10 | if id openssh-tests >/dev/null 2>&1; then | 16 | if id openssh-tests >/dev/null 2>&1; then |
@@ -21,6 +27,17 @@ EOF | |||
21 | mkdir -p "$TMP" | 27 | mkdir -p "$TMP" |
22 | cp -a . "$TMP/tree" | 28 | cp -a . "$TMP/tree" |
23 | chown -R openssh-tests:openssh-tests "$TMP" | 29 | chown -R openssh-tests:openssh-tests "$TMP" |
30 | |||
31 | # If we're running in a container, haveged may not have started | ||
32 | # automatically. Do this by hand rather than via systemctl or | ||
33 | # similar, since autopkgtests shouldn't depend on a particular init | ||
34 | # system. | ||
35 | if ! pidof haveged >/dev/null; then | ||
36 | start-stop-daemon --start --quiet \ | ||
37 | --pidfile "$TMP/haveged.pid" \ | ||
38 | --exec /usr/sbin/haveged -- -w 1024 | ||
39 | fi | ||
40 | |||
24 | sudo -u openssh-tests env TMP="$TMP" "$0" "$@" | 41 | sudo -u openssh-tests env TMP="$TMP" "$0" "$@" |
25 | exit "$?" | 42 | exit "$?" |
26 | fi | 43 | fi |