2021-07-31 22:55:47 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$(id -u)" != 0 ]; then
|
|
|
|
printf '%s: must be run as root' "$0"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$DEVMGR" ]; then
|
|
|
|
:
|
|
|
|
elif command -v mdev; then
|
|
|
|
DEVMGR=mdev
|
|
|
|
elif command -v mdevd; then
|
|
|
|
DEVMGR=mdevd
|
|
|
|
elif command -v udevd; then
|
|
|
|
DEVMGR=eudev
|
|
|
|
elif command -v /lib/systemd/systemd-udevd; then
|
|
|
|
DEVMGR=systemd-udev
|
|
|
|
elif [ -e /proc/sys/kernel/hotplug ]; then
|
|
|
|
DEVMGR=proc
|
|
|
|
else
|
|
|
|
printf '%s: device manager not found' "$0" >&2
|
|
|
|
exit 1
|
|
|
|
fi > /dev/null
|
|
|
|
|
|
|
|
export DEVMGR
|
|
|
|
|
|
|
|
if command -v modprobe > /dev/null; then
|
|
|
|
modprobe kvm
|
|
|
|
modprobe nbd
|
|
|
|
modprobe zfs
|
2021-07-31 23:37:53 +05:30
|
|
|
modprobe dm_mod
|
|
|
|
modprobe dm_crypt
|
2021-07-31 22:55:47 +05:30
|
|
|
fi
|
|
|
|
|
|
|
|
[ "$1" ] || set -- *.test
|
|
|
|
|
|
|
|
for file; do
|
|
|
|
if [ "$DEBUG" ]; then
|
|
|
|
"./${file}" 2>&1
|
|
|
|
else
|
|
|
|
"./${file}" > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $? in
|
|
|
|
222) status=SKIP ;;
|
|
|
|
0) status=PASS ;;
|
2021-08-01 00:07:49 +05:30
|
|
|
*) status=FAIL failed=1 ;;
|
2021-07-31 22:55:47 +05:30
|
|
|
esac
|
|
|
|
|
|
|
|
printf '%s: %s\n' "$file" "$status" >&2
|
|
|
|
done
|
2021-08-01 00:07:49 +05:30
|
|
|
|
|
|
|
[ -z "$failed" ]
|