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/tests/regress | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'debian/tests/regress') 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