test/common: Log all system uevents during autotest

This may be useful in debugging and pinpointing devices which may
take longer time to initialize during the tests.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5abad17e1a2690a063b6152462dcf49d22c70d0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3656
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Michal Berger 2020-08-03 16:01:53 +02:00 committed by Tomasz Zawadzki
parent d1fc288376
commit 23040b8b0c
2 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,11 @@ if [ $(uname -s) = Linux ]; then
# make sure nbd (network block device) driver is loaded if it is available # 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 # this ensures that when tests need to use nbd, it will be fully initialized
modprobe nbd || true modprobe nbd || true
if udevadm=$(type -P udevadm); then
"$udevadm" monitor --property &> "$output_dir/udev.log" &
udevadm_pid=$!
fi
fi fi
trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT

View File

@ -1186,6 +1186,9 @@ function autotest_cleanup() {
if [[ -n $old_core_pattern ]]; then if [[ -n $old_core_pattern ]]; then
echo "$old_core_pattern" > /proc/sys/kernel/core_pattern echo "$old_core_pattern" > /proc/sys/kernel/core_pattern
fi fi
if [[ -e /proc/$udevadm_pid/status ]]; then
kill "$udevadm_pid" || :
fi
} }
function freebsd_update_contigmem_mod() { function freebsd_update_contigmem_mod() {