1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: use aux clear_dev

Use wrapper over 'blkdiscard -z'
This commit is contained in:
Zdenek Kabelac 2023-04-21 13:16:22 +02:00
parent c331a3b1da
commit b2360437e0
6 changed files with 11 additions and 36 deletions

View File

@ -39,11 +39,7 @@ dd if=/dev/urandom of=randC bs=512K count=4
_prepare_vg() {
# zero devs so we are sure to find the correct file data
# on the underlying devs when corrupting it
dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev4" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev5" bs=1M oflag=direct || true
aux clear_devs "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6"
pvs
}

View File

@ -34,9 +34,7 @@ awk 'BEGIN { while (z++ < 16384) printf "C" }' > fileC
_prepare_vg() {
# zero devs so we are sure to find the correct file data
# on the underlying devs when corrupting it
dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true
aux clear_devs "$dev1" "$dev2" "$dev3"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
pvs
}

View File

@ -39,11 +39,7 @@ dd if=/dev/urandom of=randC bs=512K count=4
_prepare_vg() {
# zero devs so we are sure to find the correct file data
# on the underlying devs when corrupting it
dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev4" bs=1M oflag=direct || true
dd if=/dev/zero of="$dev5" bs=1M oflag=direct || true
aux clear_devs "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
pvs
}

View File

@ -29,9 +29,7 @@ _clear_online_files() {
aux prepare_devs 3
get_devs
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
@ -74,9 +72,7 @@ vgremove -ff $vg
# copy of the metadata.
#
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
@ -125,9 +121,7 @@ vgremove -ff $vg
# makes the VG usable.
#
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
pvcreate "$dev1"
pvcreate "$dev2"
@ -182,9 +176,7 @@ vgremove -ff $vg
# devices.
#
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
pvcreate "$dev1"
pvcreate "$dev2"
@ -258,9 +250,7 @@ if test -n "$LVM_TEST_LVMLOCKD"; then
exit 0
fi
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
@ -328,4 +318,3 @@ pvs "$dev3"
vgchange -an $vg
vgremove -ff $vg

View File

@ -118,9 +118,7 @@ vgremove -ff $vg
# metadata, and the second mda has current metadata.
#
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
dd if=/dev/zero of="$dev3" || true
aux clear_devs "$dev1" "$dev2" "$dev3"
pvcreate "$dev1"
pvcreate "$dev2"
@ -181,8 +179,7 @@ vgremove -ff $vg
# Test when the metadata on two PVs have the same seqno
# but different checksums.
dd if=/dev/zero of="$dev1" || true
dd if=/dev/zero of="$dev2" || true
aux clear_devs "$dev1" "$dev2"
pvcreate "$dev1"
pvcreate "$dev2"

View File

@ -383,8 +383,7 @@ check pv_field "$dev4" dev_size "$SIZE4"
# Verify that devs being used by an active LV are
# preferred over duplicates that are not used by an LV.
dd if=/dev/zero of="$dev3" bs=1M oflag=direct,sync || true
dd if=/dev/zero of="$dev4" bs=1M oflag=direct,sync || true
aux clear_devs "$dev3" "$dev4"
#pvscan --cache
# The previous steps prevent us from nicely cleaning up