mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: update aux for vdo checking
Detect also presence of 'vdoformat' tool. Fallback to 'kvdo' modprobe only when dm-vdo fails (removed ugly error message from log) Also add extra check for scsi model being present so the test can wait a bit if 'scsi_debug' takes longer time. No need for 'aux' within aux.
This commit is contained in:
parent
93c47a2b94
commit
bb276bf250
@ -712,7 +712,7 @@ prepare_ramdisk() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepare_real_devs() {
|
prepare_real_devs() {
|
||||||
aux lvmconf 'devices/scan = "/dev"'
|
lvmconf 'devices/scan = "/dev"'
|
||||||
|
|
||||||
touch REAL_DEVICES
|
touch REAL_DEVICES
|
||||||
|
|
||||||
@ -721,7 +721,7 @@ prepare_real_devs() {
|
|||||||
while read path; do
|
while read path; do
|
||||||
REAL_DEVICES[count]=$path
|
REAL_DEVICES[count]=$path
|
||||||
count=$(( count + 1 ))
|
count=$(( count + 1 ))
|
||||||
aux extend_filter "a|$path|"
|
extend_filter "a|$path|"
|
||||||
dd if=/dev/zero of="$path" bs=32k count=1
|
dd if=/dev/zero of="$path" bs=32k count=1
|
||||||
wipefs -a "$path" 2>/dev/null || true
|
wipefs -a "$path" 2>/dev/null || true
|
||||||
done < "$LVM_TEST_DEVICE_LIST"
|
done < "$LVM_TEST_DEVICE_LIST"
|
||||||
@ -754,6 +754,7 @@ prepare_scsi_debug_dev() {
|
|||||||
|
|
||||||
for i in {1..20} ; do
|
for i in {1..20} ; do
|
||||||
sleep .1 # allow for async Linux SCSI device registration
|
sleep .1 # allow for async Linux SCSI device registration
|
||||||
|
ls /sys/block/sd*/device/model >/dev/null 2>&1 || continue
|
||||||
DEBUG_DEV="/dev/$(grep -H scsi_debug /sys/block/sd*/device/model | cut -f4 -d /)"
|
DEBUG_DEV="/dev/$(grep -H scsi_debug /sys/block/sd*/device/model | cut -f4 -d /)"
|
||||||
test -b "$DEBUG_DEV" && break
|
test -b "$DEBUG_DEV" && break
|
||||||
done
|
done
|
||||||
@ -1845,10 +1846,11 @@ version_at_least() {
|
|||||||
# i.e. dm_target_at_least dm-thin-pool 1 0
|
# i.e. dm_target_at_least dm-thin-pool 1 0
|
||||||
target_at_least() {
|
target_at_least() {
|
||||||
rm -f debug.log strace.log
|
rm -f debug.log strace.log
|
||||||
modprobe "$1" || true
|
modprobe "$1" || {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
dm-vdo) modprobe "kvdo" || true ;;
|
dm-vdo) modprobe "kvdo" || true ;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
if test "$1" = dm-raid; then
|
if test "$1" = dm-raid; then
|
||||||
case "$(uname -r)" in
|
case "$(uname -r)" in
|
||||||
@ -1912,6 +1914,12 @@ have_vdo() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
target_at_least dm-vdo "$@"
|
target_at_least dm-vdo "$@"
|
||||||
|
|
||||||
|
vdoformat=$(lvm lvmconfig --typeconfig full --valuesonly global/vdo_format_executable || true)
|
||||||
|
# Remove surrouding "" around string
|
||||||
|
# TODO: lvmconfig should have an option to give this output directly
|
||||||
|
vdoformat=${vdoformat//\"}
|
||||||
|
test -x "$vdoformat" || { echo "No executable to format VDO \"$vdoformat\"..."; return 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
have_writecache() {
|
have_writecache() {
|
||||||
|
Loading…
Reference in New Issue
Block a user