summaryrefslogtreecommitdiffstats
path: root/debian/tests/boot-smoke
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:25:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:25:51 +0000
commitac8399db6ce846597966360732ce6d39a247bdd2 (patch)
tree046a28d2cbd02afa147291e8f69e9bb5dc29f1aa /debian/tests/boot-smoke
parentAdding upstream version 241. (diff)
downloadsystemd-ac8399db6ce846597966360732ce6d39a247bdd2.tar.xz
systemd-ac8399db6ce846597966360732ce6d39a247bdd2.zip
Adding debian version 241-7~deb10u8.debian/241-7_deb10u8debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/boot-smoke')
-rwxr-xr-xdebian/tests/boot-smoke71
1 files changed, 71 insertions, 0 deletions
diff --git a/debian/tests/boot-smoke b/debian/tests/boot-smoke
new file mode 100755
index 0000000..ed52bf6
--- /dev/null
+++ b/debian/tests/boot-smoke
@@ -0,0 +1,71 @@
+#!/bin/sh
+# test 20 successful reboots in a row
+# Author: Martin Pitt <martin.pitt@ubuntu.com>
+# For bisecting/testing you can replace individual binaries in /lib/systemd
+# with --copy /host/path/systemd-foo:/tmp/systemd-replace/systemd-foo
+set -e
+
+. `dirname $0`/assert.sh
+
+fail() {
+ journalctl --sync
+ journalctl -a > "$AUTOPKGTEST_ARTIFACTS/boot-smoke-journal.txt"
+ udevadm info --export-db > "$AUTOPKGTEST_ARTIFACTS/boot-smoke-udevdb.txt"
+ exit 1
+}
+
+if [ -z "$AUTOPKGTEST_REBOOT_MARK" ]; then
+ # enable persistent journal
+ mkdir -p /var/log/journal
+ # allow X to start even on headless machines
+ mkdir -p /etc/X11/xorg.conf.d/
+ cat << EOF > /etc/X11/xorg.conf.d/dummy.conf
+Section "Device"
+ Identifier "test"
+ Driver "dummy"
+EndSection
+EOF
+
+
+ AUTOPKGTEST_REBOOT_MARK=0
+ if [ -d /tmp/systemd-replace/ ]; then
+ for f in /tmp/systemd-replace/*; do
+ echo "Installing $f..."
+ rm -f /lib/systemd/$(basename $f)
+ cp $f /lib/systemd/
+ done
+ fi
+else
+ echo "checking for failed unmounts for user systemd"
+ # grep complete journal to catch shutdown messages
+ if journalctl | grep -E "systemd\[([2-9]|[1-9][0-9]+)\].*Failed unmounting"; then
+ fail
+ fi
+ # grep only this boot's journal, earlier ones complain about missing "render" group
+ echo "checking for connection timeouts"
+ if journalctl -b | grep "Connection timed out"; then
+ fail
+ fi
+
+ echo "checking that polkitd runs"
+ pidof polkitd
+
+ echo "checking that there are no running jobs"
+ TIMEOUT=10
+ while [ $TIMEOUT -ge 0 ]; do
+ running="$(systemctl --no-pager --no-legend list-jobs || true)"
+ [ -n "$running" ] || break
+ TIMEOUT=$((TIMEOUT - 1))
+ done
+ if [ -n "$running" ]; then
+ echo "running jobs after remaining timeout $TIMEOUT: $running"
+ fail
+ fi
+fi
+
+if [ "$AUTOPKGTEST_REBOOT_MARK" -ge 5 ]; then
+ exit 0
+fi
+
+echo "reboot #$AUTOPKGTEST_REBOOT_MARK"
+/tmp/autopkgtest-reboot $(($AUTOPKGTEST_REBOOT_MARK + 1))