summaryrefslogtreecommitdiff
path: root/debian/tests/regress
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-08-28 12:04:02 +0100
committerColin Watson <cjwatson@debian.org>2017-08-28 12:04:02 +0100
commite1c5c61f519b8ef0c210c7949789cfb33ad0cf13 (patch)
tree643a94eeb6515e7b27c159bb139b6f58f13d8954 /debian/tests/regress
parent33e4d1c2c2833ece5bd22fc2ca982a9b7f8ad97f (diff)
Run haveged during autopkgtests to ensure that they have enough entropy for key generation (LP: #1712921).
Diffstat (limited to 'debian/tests/regress')
-rwxr-xr-xdebian/tests/regress17
1 files changed, 17 insertions, 0 deletions
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 "$?"
26fi 43fi