diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-03-29 21:08:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 21:08:44 +0200 |
commit | f8e07c5cb652da80e962c4531517e96ea7076f72 (patch) | |
tree | dc6ea9e94c0e23203fe3bfe69b7f26ef234fcad8 /test | |
parent | meson: bump numbers for v251-rc1 (diff) | |
parent | test: add tests for worker error code (diff) | |
download | systemd-f8e07c5cb652da80e962c4531517e96ea7076f72.tar.xz systemd-f8e07c5cb652da80e962c4531517e96ea7076f72.zip |
Merge pull request #22871 from yuwata/udev-worker-error-code
udev: append error code on failure
Diffstat (limited to 'test')
-rwxr-xr-x | test/units/testsuite-17.03.sh | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/units/testsuite-17.03.sh b/test/units/testsuite-17.03.sh index 4c2a0410da..318afdcb5a 100755 --- a/test/units/testsuite-17.03.sh +++ b/test/units/testsuite-17.03.sh @@ -3,6 +3,7 @@ set -ex test_rule="/run/udev/rules.d/49-test.rules" +KILL_PID= setup() { mkdir -p "${test_rule%/*}" @@ -22,18 +23,37 @@ EOF teardown() { set +e + if [[ -n "$KILL_PID" ]]; then + kill "$KILL_PID" + fi + + rm -rf "$TMPDIR" + mv -f /etc/udev/udev.conf.bckp /etc/udev/udev.conf rm -f "$test_rule" systemctl restart systemd-udevd.service } run_test() { + local since + since="$(date '+%F %T')" - SYSTEMD_LOG_LEVEL=debug udevadm trigger --verbose --settle --action add /dev/null + TMPDIR=$(mktemp -d -p /tmp udev-tests.XXXXXX) + udevadm monitor --udev --property --subsystem-match=mem >"$TMPDIR"/monitor.txt & + KILL_PID="$!" - for _ in {1..20}; do + SYSTEMD_LOG_LEVEL=debug udevadm trigger --verbose --action add /dev/null + + for _ in {1..40}; do if coredumpctl --since "$since" --no-legend --no-pager | grep /bin/udevadm ; then + kill "$KILL_PID" + KILL_PID= + + cat "$TMPDIR"/monitor.txt + grep -q 'UDEV_WORKER_FAILED=1' "$TMPDIR"/monitor.txt + grep -q 'UDEV_WORKER_SIGNAL=6' "$TMPDIR"/monitor.txt + grep -q 'UDEV_WORKER_SIGNAL_NAME=ABRT' "$TMPDIR"/monitor.txt return 0 fi sleep .5 |