diff --git a/autotest.sh b/autotest.sh index 13e7e4767..bf0b78c9c 100755 --- a/autotest.sh +++ b/autotest.sh @@ -36,6 +36,11 @@ if [ $(uname -s) = Linux ]; then # make sure nbd (network block device) driver is loaded if it is available # this ensures that when tests need to use nbd, it will be fully initialized modprobe nbd || true + + if udevadm=$(type -P udevadm); then + "$udevadm" monitor --property &> "$output_dir/udev.log" & + udevadm_pid=$! + fi fi trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 8827c704c..6be1830d6 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1186,6 +1186,9 @@ function autotest_cleanup() { if [[ -n $old_core_pattern ]]; then echo "$old_core_pattern" > /proc/sys/kernel/core_pattern fi + if [[ -e /proc/$udevadm_pid/status ]]; then + kill "$udevadm_pid" || : + fi } function freebsd_update_contigmem_mod() {