From be4c6dd37f7cd1fd6c9e7818a6392ce18fb3b585 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 3 Nov 2018 18:54:08 +0000 Subject: Make the autopkgtest create /run/sshd if it doesn't already exist --- debian/changelog | 1 + debian/tests/regress | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 731fe17cc..9368bfee6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ openssh (1:7.9p1-2) UNRELEASED; urgency=medium * Add GitLab CI configuration. + * Make the autopkgtest create /run/sshd if it doesn't already exist. -- Colin Watson Sat, 03 Nov 2018 16:28:16 +0000 diff --git a/debian/tests/regress b/debian/tests/regress index e89e1940a..1c7a756f0 100755 --- a/debian/tests/regress +++ b/debian/tests/regress @@ -3,6 +3,7 @@ set -ex if [ "$(id -un)" != openssh-tests ]; then TMP="$ADTTMP/user" + CREATED_RUN_SSHD=false STARTED_HAVEGED=false cleanup () { @@ -23,6 +24,10 @@ if [ "$(id -un)" != openssh-tests ]; then if id openssh-tests >/dev/null 2>&1; then deluser --remove-home openssh-tests fi + + if $CREATED_RUN_SSHD; then + rm -rf /run/sshd + fi } trap cleanup EXIT @@ -35,6 +40,14 @@ EOF cp -a . "$TMP/tree" chown -R openssh-tests:openssh-tests "$TMP" + # Depending on how the environment is configured, our test + # dependency on openssh-server may not actually started sshd and + # thus may not have caused /run/sshd to be created. + if [ ! -d /run/sshd ]; then + mkdir -m755 /run/sshd + CREATED_RUN_SSHD=: + fi + # If we're running in a container, haveged may not have started # automatically. if [ -d /run/systemd/system ] && which systemctl >/dev/null 2>&1; then -- cgit v1.2.3