diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:26:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:26:58 +0000 |
commit | 4722d4b7980d6fd8145e2e9f08492d951ea261d1 (patch) | |
tree | 7ab498b39f5bdce46b1bbc41ef5201322df4e2d4 /debian/tests | |
parent | Adding upstream version 1:7.9p1. (diff) | |
download | openssh-debian.tar.xz openssh-debian.zip |
Adding debian version 1:7.9p1-10+deb10u2.debian/1%7.9p1-10+deb10u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/tests/control | 10 | ||||
-rwxr-xr-x | debian/tests/regress | 66 |
2 files changed, 76 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..b010ac6 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,10 @@ +Tests: regress +Restrictions: needs-root allow-stderr +Depends: devscripts, + haveged, + openssh-tests, + openssl, + putty-tools, + python-twisted-conch, + sudo, + sysvinit-utils, diff --git a/debian/tests/regress b/debian/tests/regress new file mode 100755 index 0000000..8bb73ee --- /dev/null +++ b/debian/tests/regress @@ -0,0 +1,66 @@ +#! /bin/sh +set -e + +if [ "$(id -un)" != openssh-tests ]; then + TMP="$ADTTMP/user" + CREATED_RUN_SSHD=false + STARTED_HAVEGED=false + + cleanup () { + if $STARTED_HAVEGED; then + if [ -d /run/systemd/system ] && \ + which systemctl >/dev/null 2>&1; then + systemctl disable haveged || true + systemctl stop haveged || true + else + start-stop-daemon --stop --quiet \ + --retry=TERM/30/KILL/5 \ + --pidfile "$ADTTMP/haveged.pid" \ + --name haveged + fi + fi + rm -f /etc/sudoers.d/openssh-tests + 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 + + adduser --disabled-password --gecos 'OpenSSH tests' openssh-tests + cat >/etc/sudoers.d/openssh-tests <<EOF +openssh-tests ALL = (ALL:ALL) NOPASSWD: ALL +EOF + chmod 440 /etc/sudoers.d/openssh-tests + mkdir -p "$TMP" + 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 + systemctl enable haveged || true + systemctl start haveged || true + STARTED_HAVEGED=: + elif ! pidof haveged >/dev/null; then + start-stop-daemon --start --quiet \ + --pidfile "$ADTTMP/haveged.pid" \ + --exec /usr/sbin/haveged -- -p "$ADTTMP/haveged.pid" + STARTED_HAVEGED=: + fi + + sudo -u openssh-tests env TMP="$TMP" "$0" "$@" + exit "$?" +fi + +annotate-output +%H:%M:%S.%N /usr/lib/openssh/regress/run-tests "$TMP" |