1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-24 06:04:19 +03:00

tests: use select with dmsetup

Use 'dmsetup -S' to greatly simplify such loops.
This commit is contained in:
Zdenek Kabelac 2018-11-23 20:08:08 +01:00 committed by David Teigland
parent b252c20eb9
commit 0172a76622
3 changed files with 6 additions and 39 deletions

View File

@ -23,19 +23,8 @@ aux prepare_vg 4 32
# FIXME: lvconvert leaks 'error' devices
detect_error_leak_()
{
local err=""
for i in $(dmsetup info -c -o name --noheadings) ; do
case "$i" in
"$vg*") (dmsetup table "$i" | grep "error ") && err="$err $i" ;;
esac
done
test -z "$err" || {
dmsetup table | grep $vg
dmsetup ls --tree
die "Device(s) $err should not be here."
}
dmsetup table -S "name=~^$vg-" | not grep "error" || \
die "Device(s) with error target should not be here."
}
# Create linear LV

View File

@ -23,19 +23,8 @@ aux prepare_vg 4 32
# FIXME: lvconvert leaks 'error' devices
detect_error_leak_()
{
local err=""
for i in $(dmsetup info -c -o name --noheadings) ; do
case "$i" in
"$vg*") (dmsetup table "$i" | grep "error ") && err="$err $i" ;;
esac
done
test -z "$err" || {
dmsetup table | grep $vg
dmsetup ls --tree
die "Device(s) $err should not be here."
}
dmsetup table -S "name=~^$vg-" | not grep "error" || \
die "Device(s) with error target should not be here."
}
# Create 3-way striped raid4 (4 legs total)

View File

@ -26,19 +26,8 @@ aux prepare_vg 8
# FIXME: lvconvert leaks 'error' devices
detect_error_leak_()
{
local err=""
for i in $(dmsetup info -c -o name --noheadings) ; do
case "$i" in
"$vg*") (dmsetup table "$i" | grep "error ") && err="$err $i" ;;
esac
done
test -z "$err" || {
dmsetup table | grep $vg
dmsetup ls --tree
die "Device(s) $err should not be here."
}
dmsetup table -S "name=~^$vg-" | not grep "error" || \
die "Device(s) with error target should not be here."
}
function _lvcreate