mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: replace cat usage
This commit is contained in:
parent
e11de5847d
commit
160cb1e713
@ -29,7 +29,8 @@ diff -u dmstats-version lib/dm-version-expected
|
||||
|
||||
# ensure we can create devices (uses dmsetup, etc)
|
||||
aux prepare_devs 5
|
||||
get_devs
|
||||
|
||||
# ensure we do not crash on a bug in config file
|
||||
aux lvmconf 'log/prefix = 1""'
|
||||
not lvs $(cat DEVICES)
|
||||
not lvs "${DEVICES[@]}"
|
||||
|
@ -29,7 +29,7 @@ pvcreate --metadatacopies 0 "$dev3"
|
||||
# FIXME takes very long time
|
||||
#pvck "$dev1"
|
||||
|
||||
vgcreate $vg "${DEVICES[@]}"
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -l 5 -i5 -I256 -n $lv $vg
|
||||
lvcreate -aey -l 5 -n $lv1 $vg
|
||||
|
@ -26,6 +26,7 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
|
||||
aux have_thin 1 1 0 || skip
|
||||
|
||||
aux prepare_vg 2 64
|
||||
get_devs
|
||||
|
||||
aux extend_filter_LVMTEST
|
||||
|
||||
@ -79,7 +80,7 @@ vgremove -ff $vg
|
||||
# device below does not support it, the kernel value
|
||||
# of discards actually used will be "nopassdown".
|
||||
# This is why we have "-o discards" and "-o kernel_discards".
|
||||
vgcreate -s 1m ${vg}_1 $(cat DEVICES)
|
||||
vgcreate -s 1m "${vg}_1" "${DEVICES[@]}"
|
||||
lvcreate -l 10 -T ${vg}_1/pool --discards ignore
|
||||
lvcreate -V 9m -T ${vg}_1/pool -n device_with_ignored_discards
|
||||
vgcreate -s 1m ${vg}_2 "$DM_DEV_DIR/${vg}_1/device_with_ignored_discards"
|
||||
|
@ -16,15 +16,16 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_vg 3 12
|
||||
get_devs
|
||||
|
||||
lvcreate -aye --type mirror -m 1 -l 1 -n mirror $vg
|
||||
lvcreate -l 1 -n resized $vg
|
||||
lvchange -a n $vg/mirror
|
||||
|
||||
aux backup_dev $(cat DEVICES)
|
||||
aux backup_dev "${DEVICES[@]}"
|
||||
|
||||
init() {
|
||||
aux restore_dev $(cat DEVICES)
|
||||
aux restore_dev "${DEVICES[@]}"
|
||||
not check lv_field $vg/resized lv_size "8.00m"
|
||||
lvresize -L 8192K $vg/resized
|
||||
aux restore_dev "$dev1"
|
||||
@ -69,8 +70,8 @@ fi
|
||||
|
||||
echo Check auto-repair of failed vgextend - metadata written to original pv but not new pv
|
||||
vgremove -f $vg
|
||||
pvremove -ff $(cat DEVICES)
|
||||
pvcreate $(cat DEVICES)
|
||||
pvremove -ff "${DEVICES[@]}"
|
||||
pvcreate "${DEVICES[@]}"
|
||||
aux backup_dev "$dev2"
|
||||
vgcreate $vg "$dev1"
|
||||
vgextend $vg "$dev2"
|
||||
|
@ -16,10 +16,11 @@ SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
aux have_thin 1 0 0 || skip
|
||||
aux prepare_pvs 1 16
|
||||
get_devs
|
||||
|
||||
aux lvmconf "metadata/record_lvs_history=1"
|
||||
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -l100%FREE -T ${vg}/pool
|
||||
|
||||
|
@ -19,6 +19,7 @@ which mkfs.ext4 || skip
|
||||
aux have_raid 1 3 5 || skip
|
||||
|
||||
aux prepare_vg 4
|
||||
get_devs
|
||||
|
||||
for d in "$dev1" "$dev2" "$dev3" "$dev4"
|
||||
do
|
||||
@ -35,7 +36,7 @@ not lvchange -y --writemostly "$dev1" "$vg/$lv1"
|
||||
check lv_field $vg/$lv1 segtype "raid1"
|
||||
check lv_field $vg/$lv1 stripes 4
|
||||
check lv_attr_bit health $vg/${lv1}_rimage_0 "-"
|
||||
aux enable_dev $(< DEVICES)
|
||||
aux enable_dev "${DEVICES[@]}"
|
||||
aux wait_for_sync $vg $lv1
|
||||
lvchange -y --writemostly "$dev1" "$vg/$lv1"
|
||||
check lv_attr_bit health $vg/${lv1}_rimage_0 "w"
|
||||
|
@ -18,19 +18,20 @@ SKIP_WITH_LVMPOLLD=1
|
||||
aux have_raid 1 3 2 || skip
|
||||
|
||||
aux prepare_vg 8
|
||||
get_devs
|
||||
|
||||
_sync() {
|
||||
aux enable_dev $(< DEVICES)
|
||||
aux enable_dev "${DEVICES[@]}"
|
||||
|
||||
aux wait_for_sync $vg $lv1
|
||||
test -z "$1" || check raid_leg_status $vg $lv1 $1
|
||||
|
||||
# restore to delay_dev tables for all devices
|
||||
aux restore_from_devtable $(< DEVICES)
|
||||
aux restore_from_devtable "${DEVICES[@]}"
|
||||
}
|
||||
|
||||
# Delay legs so that rebuilding status characters can be read
|
||||
for d in $(< DEVICES)
|
||||
for d in "${DEVICES[@]}"
|
||||
do
|
||||
aux delay_dev "$d" 0 50 "$(get first_extent_sector "$d")"
|
||||
done
|
||||
|
@ -17,8 +17,9 @@ SKIP_WITH_LVMLOCKD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 3
|
||||
get_devs
|
||||
|
||||
vgcreate -s 64k $vg $(cat DEVICES)
|
||||
vgcreate -s 64k "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -aey -l10 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2"
|
||||
|
||||
|
@ -18,9 +18,11 @@ export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 5 20
|
||||
get_devs
|
||||
|
||||
# proper DEVRANGE needs to be set according to extent size
|
||||
DEVRANGE="0-32"
|
||||
vgcreate -s 32k $vg $(cat DEVICES)
|
||||
vgcreate -s 32k "$vg" "${DEVICES[@]}"
|
||||
|
||||
# convert from linear to 2-way mirror ("mirror" default type)
|
||||
lvcreate -aey -l2 -n $lv1 $vg "$dev1"
|
||||
|
@ -18,7 +18,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
aux have_raid 1 3 0 || skip
|
||||
|
||||
aux prepare_pvs 5
|
||||
vgcreate -s 256k $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 256k "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Start with linear on 2 PV and ensure that converting to
|
||||
# RAID is not allowed to reuse PVs for different images. (Bug 1113180)
|
||||
|
@ -24,7 +24,7 @@ aux have_multi_core || skip
|
||||
|
||||
aux prepare_pvs 65 64
|
||||
|
||||
vgcreate -s 1M $vg $(cat DEVICES)
|
||||
vgcreate -s 1M "$vg" "${DEVICES[@]}"
|
||||
|
||||
function _lvcreate
|
||||
{
|
||||
|
@ -27,7 +27,9 @@ export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
|
||||
aux have_raid 1 9 0 || skip
|
||||
|
||||
aux prepare_pvs 9
|
||||
vgcreate -s 2m $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 2m "$vg" "${DEVICES[@]}"
|
||||
|
||||
###########################################
|
||||
# Upconverted RAID1 should never have all 'a's in status output
|
||||
|
@ -33,8 +33,10 @@ get_image_pvs() {
|
||||
aux have_raid 1 3 0 || skip
|
||||
|
||||
aux prepare_pvs 9
|
||||
# vgcreate -s 256k $vg $(cat DEVICES)
|
||||
vgcreate -s 2m $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
# vgcreate -s 256k "$vg" "${DEVICES[@]}"
|
||||
vgcreate -s 2m "$vg" "${DEVICES[@]}"
|
||||
|
||||
###########################################
|
||||
# RAID1 convert tests
|
||||
|
@ -32,7 +32,9 @@ aux have_raid 1 3 1 || skip
|
||||
|
||||
# 9 PVs needed for RAID10 testing (3-stripes/2-mirror - replacing 3 devs)
|
||||
aux prepare_pvs 9 80
|
||||
vgcreate -s 256k $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 256k "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg
|
||||
aux wait_for_sync $vg $lv1
|
||||
|
@ -17,7 +17,7 @@ SKIP_WITH_LVMLOCKD=1
|
||||
recreate_vg_()
|
||||
{
|
||||
vgremove -ff $vg
|
||||
vgcreate $vg "$@" $(cat DEVICES)
|
||||
vgcreate "$vg" "$@" "${DEVICES[@]}"
|
||||
}
|
||||
|
||||
_check_mlog()
|
||||
@ -36,6 +36,8 @@ aux lvmconf "allocation/maximise_cling = 0" \
|
||||
|
||||
# 4-way, disk log => 2-way, disk log
|
||||
aux prepare_vg 8
|
||||
get_devs
|
||||
|
||||
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0
|
||||
aux disable_dev "$dev2" "$dev4"
|
||||
echo n | lvconvert --repair $vg/4way 2>&1 | tee 4way.out
|
||||
|
@ -18,8 +18,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 1
|
||||
get_devs
|
||||
|
||||
vgcreate -s 1k $vg $(cat DEVICES)
|
||||
vgcreate -s 1k "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate --type snapshot -V50 -L1 -n $lv1 -s $vg
|
||||
|
||||
|
@ -28,8 +28,9 @@ which fsck || skip
|
||||
aux have_thin 1 5 0 || skip
|
||||
|
||||
aux prepare_pvs 2 64
|
||||
get_devs
|
||||
|
||||
vgcreate $vg --metadatasize 128K -s 64K $(cat DEVICES)
|
||||
vgcreate "$vg" --metadatasize 128K -s 64K "${DEVICES[@]}"
|
||||
|
||||
if test 0 -eq 1 ; then
|
||||
# FIXME: needs patch to allow inactive old-snap creation
|
||||
|
@ -29,9 +29,10 @@ prepare_lvs() {
|
||||
aux have_thin 1 0 0 || skip
|
||||
|
||||
aux prepare_pvs 4 64
|
||||
get_devs
|
||||
|
||||
# build one large PV
|
||||
vgcreate $vg1 $(head -n 3 DEVICES)
|
||||
vgcreate $vg1 "$dev1" "$dev2" "$dev3"
|
||||
|
||||
# 32bit linux kernels are fragille with device size >= 16T
|
||||
# maybe uname -m [ x86_64 | i686 ]
|
||||
@ -41,7 +42,7 @@ lvcreate --type snapshot -l 100%FREE -n $lv $vg1 --virtualsize $TSIZE
|
||||
aux extend_filter_LVMTEST
|
||||
|
||||
pvcreate "$DM_DEV_DIR/$vg1/$lv"
|
||||
vgcreate $vg -s 64K $(tail -n+4 DEVICES) "$DM_DEV_DIR/$vg1/$lv"
|
||||
vgcreate $vg -s 64K "$dev4" "$DM_DEV_DIR/$vg1/$lv"
|
||||
|
||||
lvcreate -L1T -n $lv1 $vg
|
||||
invalid lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1
|
||||
|
@ -27,13 +27,14 @@ aux have_raid4 && segtypes="raid4 raid5"
|
||||
|
||||
# Prepare 5x ~1P sized devices
|
||||
aux prepare_pvs 5 1000000000
|
||||
get_devs
|
||||
|
||||
vgcreate $vg1 $(< DEVICES)
|
||||
vgcreate "$vg1" "${DEVICES[@]}"
|
||||
|
||||
aux lvmconf 'devices/issue_discards = 1'
|
||||
|
||||
# Delay PVs so that resynchronization doesn't fill too much space
|
||||
for device in $(< DEVICES)
|
||||
for device in "${DEVICES[@]}"
|
||||
do
|
||||
aux delay_dev "$device" 0 10 "$(get first_extent_sector "$device")"
|
||||
done
|
||||
|
@ -24,8 +24,10 @@ cleanup_lvs() {
|
||||
}
|
||||
|
||||
aux prepare_pvs 2
|
||||
get_devs
|
||||
|
||||
aux pvcreate --metadatacopies 0 "$dev1"
|
||||
aux vgcreate $vg $(cat DEVICES)
|
||||
aux vgcreate "$vg" "${DEVICES[@]}"
|
||||
|
||||
# ---
|
||||
# Create snapshots of LVs on --metadatacopies 0 PV (bz450651)
|
||||
|
@ -16,14 +16,16 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 3
|
||||
get_devs
|
||||
|
||||
aux lvmconf 'allocation/maximise_cling = 0' \
|
||||
'allocation/mirror_logs_require_separate_pvs = 1'
|
||||
|
||||
# not required, just testing
|
||||
aux pvcreate --metadatacopies 0 "$dev1"
|
||||
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
pvchange --addtag fast $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
pvchange --addtag fast "${DEVICES[@]}"
|
||||
|
||||
# 3 stripes with 3 PVs (selected by tag, @fast) is fine
|
||||
lvcreate -l3 -i3 $vg @fast
|
||||
|
@ -28,7 +28,9 @@ RAID4=""
|
||||
aux have_raid4 && RAID4=raid4
|
||||
|
||||
aux prepare_pvs 6 20 # 6 devices for RAID10 (2-mirror,3-stripe) test
|
||||
vgcreate -s 512k $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 512k "$vg" "${DEVICES[@]}"
|
||||
|
||||
###########################################
|
||||
# Create, wait for sync, remove tests
|
||||
|
@ -16,8 +16,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs
|
||||
get_devs
|
||||
|
||||
vgcreate -s 1k $vg $(cat DEVICES)
|
||||
vgcreate -s 1k "$vg" "${DEVICES[@]}"
|
||||
|
||||
# 3 Chunks
|
||||
lvcreate -aey -n one -l 10 $vg
|
||||
|
@ -25,7 +25,9 @@ aux have_thin 1 0 0 || skip
|
||||
# Test --poolmetadatasize range
|
||||
# allocating large devices for testing
|
||||
aux prepare_pvs 10 16500
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Size 0 is not valid
|
||||
invalid lvcreate -L4M --chunksize 128 --poolmetadatasize 0 -T $vg/pool1 2>out
|
||||
|
@ -29,9 +29,10 @@ which cmp || skip
|
||||
aux have_thin 1 13 0 || skip
|
||||
|
||||
aux prepare_pvs 2 640
|
||||
get_devs
|
||||
|
||||
# Use 8K extent size
|
||||
vgcreate $vg -s 8K $(cat DEVICES)
|
||||
vgcreate -s 8K "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Prepare some numeric pattern with ~64K size
|
||||
seq -s ' ' -w 0 10922 > 64K
|
||||
|
@ -28,8 +28,9 @@ which fsck || skip
|
||||
aux have_thin 1 3 0 || skip
|
||||
|
||||
aux prepare_pvs 2 64
|
||||
get_devs
|
||||
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Newer thin-pool target (>= 1.13) supports unaligned external origin
|
||||
# But this test is written to test and expect older behavior
|
||||
|
@ -26,8 +26,9 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
|
||||
aux have_thin 1 4 0 || skip
|
||||
|
||||
aux prepare_pvs 2 64
|
||||
get_devs
|
||||
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
# create non-power-of-2 pool
|
||||
lvcreate -l100 -c 192 -T $vg/pool
|
||||
|
@ -35,8 +35,9 @@ aux have_thin 1 0 0 || skip
|
||||
which mkfs.ext4 || skip
|
||||
|
||||
aux prepare_pvs 2 64
|
||||
get_devs
|
||||
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -L10M -V10M -T $vg/pool --name $lv1
|
||||
mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
|
||||
|
@ -37,8 +37,9 @@ aux have_thin 1 0 0 || skip
|
||||
which mkfs.ext4 || skip
|
||||
|
||||
aux prepare_pvs 2 64
|
||||
get_devs
|
||||
|
||||
vgcreate $vg -s 64K $(cat DEVICES)
|
||||
vgcreate -s 64K "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Create named pool only
|
||||
lvcreate -l1 -T $vg/pool1
|
||||
|
@ -17,8 +17,10 @@ SKIP_WITH_LVMLOCKD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 4
|
||||
get_devs
|
||||
|
||||
aux pvcreate --metadatacopies 0 "$dev1"
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
aux vgcreate "$vg" "${DEVICES[@]}"
|
||||
|
||||
invalid lvcreate --type free -l1 -n $lv1 $vg 2>err
|
||||
grep "Invalid argument for --type" err
|
||||
|
@ -18,7 +18,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 2 128
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
aux vgcreate "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -L64 -n $lv $vg
|
||||
|
||||
|
@ -36,8 +36,9 @@ aux lvmconf "activation/thin_pool_autoextend_percent = 10" \
|
||||
"activation/thin_pool_autoextend_threshold = 75"
|
||||
|
||||
aux prepare_pvs 3 256
|
||||
get_devs
|
||||
|
||||
vgcreate -s 256K $vg $(cat DEVICES)
|
||||
vgcreate -s 256K "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -L1M -c 64k -T $vg/pool
|
||||
lvcreate -V1M $vg/pool -n $lv1
|
||||
|
@ -62,8 +62,9 @@ aux have_thin 1 10 0 || skip
|
||||
aux prepare_dmeventd
|
||||
|
||||
aux prepare_pvs 3 256
|
||||
get_devs
|
||||
|
||||
vgcreate -s 1M $vg $(cat DEVICES)
|
||||
vgcreate -s 1M "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Testing dmeventd does NOT autoresize when default threshold 100% is left
|
||||
lvcreate -L200M -V50M -n thin -T $vg/pool
|
||||
|
@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 5
|
||||
get_devs
|
||||
|
||||
vgcreate $vg1 "$dev1"
|
||||
vgcreate $vg2 "$dev3" "$dev4" "$dev5"
|
||||
@ -25,7 +26,7 @@ UUID1=$(get vg_field $vg1 uuid)
|
||||
aux disable_dev "$dev1"
|
||||
pvscan
|
||||
# dev1 is missing
|
||||
fail pvs $(cat DEVICES)
|
||||
fail pvs "${DEVICES[@]}"
|
||||
|
||||
# create a new vg1 on dev2,
|
||||
# so dev1 and dev2 have different VGs with the same name
|
||||
|
@ -16,8 +16,10 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 1 20000
|
||||
pvs $(cat DEVICES) | grep "$dev1"
|
||||
get_devs
|
||||
|
||||
pvs "${DEVICES[@]}" | grep "$dev1"
|
||||
|
||||
# check for PV size overflows
|
||||
pvs $(cat DEVICES) | grep 19.53g
|
||||
pvs $(cat DEVICES) | not grep 16.00e
|
||||
pvs "${DEVICES[@]}" | grep 19.53g
|
||||
pvs "${DEVICES[@]}" | not grep 16.00e
|
||||
|
@ -22,8 +22,9 @@ aux have_raid4 && levels="4 $levels"
|
||||
aux have_raid 1 7 0 && levels="0 0_meta $levels"
|
||||
|
||||
aux prepare_pvs 6
|
||||
get_devs
|
||||
|
||||
vgcreate -s 256K $vg $(cat DEVICES)
|
||||
vgcreate -s 256K "$vg" "${DEVICES[@]}"
|
||||
|
||||
for deactivate in true false; do
|
||||
|
||||
|
@ -16,8 +16,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 3 22
|
||||
get_devs
|
||||
|
||||
vgcreate -s 32K $vg $(cat DEVICES)
|
||||
vgcreate -s 32K "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -an -Zn -l4 -i3 -I64 $vg
|
||||
|
||||
|
@ -16,9 +16,10 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 3
|
||||
get_devs
|
||||
|
||||
pvcreate --metadatacopies 0 $(cat DEVICES)
|
||||
not vgcreate $vg $(cat DEVICES)
|
||||
pvcreate --metadatacopies 0 "${DEVICES[@]}"
|
||||
not vgcreate "$vg" "${DEVICES[@]}"
|
||||
|
||||
aux lvmconf "metadata/dirs = [ \"$TESTDIR/mda\" ]"
|
||||
|
||||
@ -26,22 +27,22 @@ vgcreate $vg "$dev1"
|
||||
check vg_field $vg vg_mda_count 1
|
||||
vgremove -ff $vg
|
||||
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
check vg_field $vg vg_mda_count 1
|
||||
vgremove -ff $vg
|
||||
|
||||
pvcreate --metadatacopies 1 --metadataignore y "$dev1"
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
check vg_field $vg vg_mda_count 2
|
||||
vgremove -ff $vg
|
||||
|
||||
pvcreate --metadatacopies 1 --metadataignore n "$dev1"
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
check vg_field $vg vg_mda_count 2
|
||||
vgremove -ff $vg
|
||||
|
||||
pvcreate --metadatacopies 0 "$dev1"
|
||||
aux lvmconf "metadata/dirs = [ \"$TESTDIR/mda\", \"$TESTDIR/mda2\" ]"
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
check vg_field $vg vg_mda_count 2
|
||||
vgremove -ff $vg
|
||||
|
@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 5
|
||||
get_devs
|
||||
|
||||
pvcreate "$dev1"
|
||||
pvcreate --metadatacopies 0 "$dev2"
|
||||
@ -23,7 +24,7 @@ pvcreate --metadatacopies 0 "$dev3"
|
||||
pvcreate "$dev4"
|
||||
pvcreate --metadatacopies 0 "$dev5"
|
||||
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
lvcreate -n $lv -l 1 -i5 -I256 $vg
|
||||
|
||||
pvchange -x n "$dev1"
|
||||
@ -35,9 +36,9 @@ vgremove -f $vg
|
||||
|
||||
# check that PVs without metadata don't cause too many full device rescans (bz452606)
|
||||
for mdacp in 1 0; do
|
||||
pvcreate --metadatacopies $mdacp $(cat DEVICES)
|
||||
pvcreate --metadatacopies "$mdacp" "${DEVICES[@]}"
|
||||
pvcreate "$dev1"
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
lvcreate -n $lv1 -l 2 -i5 -I256 $vg
|
||||
lvcreate -aey -n $lv2 --type mirror -m2 -l 2 $vg
|
||||
lvchange -an $vg/$lv1 $vg/$lv2
|
||||
@ -61,7 +62,7 @@ check pv_field "$dev1" pe_start $pv_align
|
||||
check pv_field "$dev2" pe_start $pv_align
|
||||
check pv_field "$dev3" pe_start $pv_align
|
||||
|
||||
pvs --units k -o name,pe_start,vg_mda_size,vg_name $(cat DEVICES)
|
||||
pvs --units k -o name,pe_start,vg_mda_size,vg_name "${DEVICES[@]}"
|
||||
|
||||
# upgrade from v1 to v2 metadata
|
||||
vgconvert -M2 $vg
|
||||
@ -71,7 +72,7 @@ check pv_field "$dev1" pe_start $pv_align
|
||||
check pv_field "$dev2" pe_start $pv_align
|
||||
check pv_field "$dev3" pe_start $pv_align
|
||||
|
||||
pvs --units k -o name,pe_start,vg_mda_size,vg_name $(cat DEVICES)
|
||||
pvs --units k -o name,pe_start,vg_mda_size,vg_name "${DEVICES[@]}"
|
||||
|
||||
# create backup and then restore $dev3
|
||||
vgcfgbackup -f "$TESTDIR/bak-%s" "$vg"
|
||||
|
@ -95,8 +95,9 @@ rest_pvs_()
|
||||
# Initialize PVs and VGs
|
||||
|
||||
aux prepare_pvs 5 80
|
||||
get_devs
|
||||
|
||||
vgcreate -s 64k $vg $(cat DEVICES)
|
||||
vgcreate -s 64k "$vg" "${DEVICES[@]}"
|
||||
BLOCKS=0-7
|
||||
BLOCKS1=8-15
|
||||
# ---------------------------------------------------------------------
|
||||
|
@ -26,7 +26,7 @@ which md5sum || skip
|
||||
# Utilities
|
||||
|
||||
create_vg_() {
|
||||
vgcreate -c n -s 128k $vg $(cat DEVICES)
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
@ -84,6 +84,8 @@ check_and_cleanup_lvs_() {
|
||||
# Initialize PVs and VGs
|
||||
|
||||
aux prepare_pvs 5 5
|
||||
get_devs
|
||||
|
||||
create_vg_
|
||||
|
||||
for mode in "--atomic" ""
|
||||
@ -343,7 +345,7 @@ check_and_cleanup_lvs_
|
||||
|
||||
#COMM "pvmove out of --metadatacopies 0 PV (bz252150)"
|
||||
vgremove -ff $vg
|
||||
pvcreate $(cat DEVICES)
|
||||
pvcreate "${DEVICES[@]}"
|
||||
pvcreate --metadatacopies 0 "$dev1" "$dev2"
|
||||
create_vg_
|
||||
lvcreate -l4 -n $lv1 $vg "$dev1"
|
||||
|
@ -21,7 +21,9 @@ which md5sum || skip
|
||||
aux have_raid 1 3 5 || skip
|
||||
|
||||
aux prepare_pvs 5 20
|
||||
vgcreate -c n -s 128k $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
|
||||
for mode in "--atomic" ""
|
||||
do
|
||||
|
@ -23,7 +23,9 @@ aux have_thin 1 8 0 || skip
|
||||
aux have_raid 1 3 5 || skip
|
||||
|
||||
aux prepare_pvs 5 20
|
||||
vgcreate -c n -s 128k $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
|
||||
for mode in "--atomic" ""
|
||||
do
|
||||
|
@ -19,8 +19,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 2
|
||||
get_devs
|
||||
|
||||
vgcreate --metadatatype 1 $vg $(cat DEVICES)
|
||||
vgcreate --metadatatype 1 "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Make origin volume
|
||||
lvcreate -ae -l5 $vg -n origin
|
||||
|
@ -19,8 +19,9 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 1
|
||||
get_devs
|
||||
|
||||
vgcreate -s 1K $vg $(cat DEVICES)
|
||||
vgcreate -s 1K "$vg" "${DEVICES[@]}"
|
||||
|
||||
lvcreate -aey -L1 -n $lv1 $vg
|
||||
# Snapshot should be large enough to handle any writes
|
||||
|
@ -21,9 +21,10 @@ SKIP_WITH_LVMPOLLD=1
|
||||
aux can_use_16T || skip
|
||||
|
||||
aux prepare_pvs 1
|
||||
get_devs
|
||||
|
||||
# Prepare large enough backend device
|
||||
vgcreate -s 4M $vg $(cat DEVICES)
|
||||
vgcreate -s 4M "$vg" "${DEVICES[@]}"
|
||||
lvcreate --type snapshot -s -l 100%FREE -n $lv $vg --virtualsize 15P
|
||||
aux extend_filter_LVMTEST
|
||||
|
||||
|
@ -57,7 +57,9 @@ if aux target_at_least dm-snapshot 1 10 0 ; then
|
||||
fi
|
||||
|
||||
aux prepare_pvs 1
|
||||
vgcreate -s 4M $vg $(cat DEVICES)
|
||||
get_devs
|
||||
|
||||
vgcreate -s 4M "$vg" "${DEVICES[@]}"
|
||||
|
||||
# Play with 1 extent
|
||||
lvcreate -aey -l1 -n $lv $vg
|
||||
|
@ -16,9 +16,11 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 3
|
||||
get_devs
|
||||
|
||||
cp -r "$dev1" "$DM_DEV_DIR/stray"
|
||||
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
|
||||
aux disable_dev "$dev1"
|
||||
# FIXME:
|
||||
|
@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 4
|
||||
get_devs
|
||||
|
||||
if test -n "$LVM_TEST_LVM1" ; then
|
||||
|
||||
@ -26,8 +27,8 @@ aux lvmconf "backup/backup = 0"
|
||||
|
||||
# vgcfgbackup correctly stores metadata LVM1 with missing PVs
|
||||
|
||||
pvcreate -M1 $(cat DEVICES)
|
||||
vgcreate -M1 -c n $vg $(cat DEVICES)
|
||||
pvcreate -M1 "${DEVICES[@]}"
|
||||
vgcreate -M1 -c n "$vg" "${DEVICES[@]}"
|
||||
lvcreate -l1 -n $lv1 $vg "$dev1"
|
||||
pvremove -ff -y "$dev2"
|
||||
not lvcreate -l1 -n $lv1 $vg "$dev3"
|
||||
|
@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_pvs 4
|
||||
get_devs
|
||||
|
||||
pvcreate --metadatacopies 0 "$dev4"
|
||||
|
||||
@ -57,7 +58,7 @@ vgremove -ff $vg1 $vg2
|
||||
# and vgcfgrestore able to restore them when device reappears
|
||||
pv1_uuid=$(get pv_field "$dev1" pv_uuid)
|
||||
pv2_uuid=$(get pv_field "$dev2" pv_uuid)
|
||||
vgcreate $vg $(cat DEVICES)
|
||||
vgcreate "$vg" "${DEVICES[@]}"
|
||||
lvcreate -l1 -n $lv1 $vg "$dev1"
|
||||
lvcreate -l1 -n $lv2 $vg "$dev2"
|
||||
lvcreate -l1 -n $lv3 $vg "$dev3"
|
||||
|
@ -19,21 +19,22 @@ SKIP_WITH_LVMPOLLD=1
|
||||
# FIXME: lvmetad fails with i.e. 1500 device on memory failure...
|
||||
|
||||
# Number of LVs to create
|
||||
DEVICES=1000
|
||||
TEST_DEVS=1000
|
||||
# On low-memory boxes let's not stress too much
|
||||
test "$(aux total_mem)" -gt 524288 || DEVICES=256
|
||||
test "$(aux total_mem)" -gt 524288 || TEST_DEVS=256
|
||||
|
||||
aux prepare_pvs 1 400
|
||||
get_devs
|
||||
|
||||
vgcreate -s 128K $vg $(cat DEVICES)
|
||||
vgcreate -s 128K "$vg" "${DEVICES[@]}"
|
||||
|
||||
vgcfgbackup -f data $vg
|
||||
|
||||
# Generate a lot of devices (size of 1 extent)
|
||||
awk -v DEVICES=$DEVICES '/^\t\}/ {
|
||||
awk -v TEST_DEVS=$TEST_DEVS '/^\t\}/ {
|
||||
printf("\t}\n\tlogical_volumes {\n");
|
||||
cnt=0;
|
||||
for (i = 0; i < DEVICES; i++) {
|
||||
for (i = 0; i < TEST_DEVS; i++) {
|
||||
printf("\t\tlvol%06d {\n", i);
|
||||
printf("\t\t\tid = \"%06d-1111-2222-3333-2222-1111-%06d\"\n", i, i);
|
||||
print "\t\t\tstatus = [\"READ\", \"WRITE\", \"VISIBLE\"]";
|
||||
|
@ -17,14 +17,15 @@ SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
aux prepare_dmeventd
|
||||
aux prepare_pvs 3
|
||||
get_devs
|
||||
|
||||
vgcreate -l 2 $vg $(cat DEVICES)
|
||||
vgcreate -l 2 "$vg" "${DEVICES[@]}"
|
||||
lvcreate -aey -n one -l 1 $vg
|
||||
lvcreate -n two -l 1 $vg
|
||||
not lvcreate -n three -l 1 $vg
|
||||
vgremove -ff $vg
|
||||
|
||||
vgcreate -l 3 $vg $(cat DEVICES)
|
||||
vgcreate -l 3 "$vg" "${DEVICES[@]}"
|
||||
lvcreate -aey -n one -l 1 $vg
|
||||
lvcreate -n snap -s -l 1 $vg/one
|
||||
lvcreate -n two -l 1 $vg
|
||||
|
@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 4
|
||||
get_devs
|
||||
|
||||
if test -n "$LVM_TEST_LVM1" ; then
|
||||
mdatypes='1 2'
|
||||
@ -78,11 +79,11 @@ not vgs $vg1 # just double-check it's really gone
|
||||
|
||||
#COMM "vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too"
|
||||
# (lvm$mdatype) setup: create mirror + linear lvs
|
||||
vgcreate -M$mdatype $vg1 $(cat DEVICES)
|
||||
vgcreate -M$mdatype "$vg1" "${DEVICES[@]}"
|
||||
lvcreate -n $lv2 -l 4 $vg1
|
||||
lvcreate -aey --type mirror -m1 -n $lv1 -l 4 $vg1 "$dev1" "$dev2" "$dev3"
|
||||
lvcreate -n $lv3 -l 4 $vg1 "$dev3"
|
||||
pvs --segments -o +lv_name $(cat DEVICES) # for record only
|
||||
pvs --segments -o +lv_name "${DEVICES[@]}" # for record only
|
||||
# (lvm$mdatype) setup: damage one pv
|
||||
vgchange -an $vg1
|
||||
aux disable_dev "$dev1"
|
||||
@ -94,7 +95,7 @@ vgreduce --removemissing --mirrorsonly --force $vg1
|
||||
|
||||
aux enable_dev "$dev1"
|
||||
|
||||
pvs -P $(cat DEVICES) # for record
|
||||
pvs -P "${DEVICES[@]}" # for record
|
||||
lvs -P $vg1 # for record
|
||||
vgs -P $vg1 # for record
|
||||
|
||||
|
@ -22,8 +22,9 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
|
||||
aux have_thin 1 0 0 || skip
|
||||
|
||||
aux prepare_devs 5
|
||||
get_devs
|
||||
|
||||
vgcreate $vg1 $(cat DEVICES)
|
||||
vgcreate "$vg1" "${DEVICES[@]}"
|
||||
lvcreate -T -L8M $vg1/pool1 -V10M -n $lv1 "$dev1" "$dev2"
|
||||
lvcreate -T -L8M $vg1/pool2 -V10M -n $lv2 "$dev3" "$dev4"
|
||||
|
||||
|
@ -18,6 +18,7 @@ SKIP_WITH_LVMPOLLD=1
|
||||
. lib/inittest
|
||||
|
||||
aux prepare_devs 5
|
||||
get_devs
|
||||
|
||||
if test -n "$LVM_TEST_LVM1" ; then
|
||||
mdatypes='1 2'
|
||||
@ -28,21 +29,21 @@ fi
|
||||
for mdatype in $mdatypes
|
||||
do
|
||||
|
||||
pvcreate -M$mdatype $(cat DEVICES)
|
||||
pvcreate -M$mdatype "${DEVICES[@]}"
|
||||
|
||||
# ensure name order does not matter
|
||||
# NOTE: if we're using lvm1, we must use -M on vgsplit
|
||||
vgcreate -M$mdatype $vg1 $(cat DEVICES)
|
||||
vgcreate -M$mdatype "$vg1" "${DEVICES[@]}"
|
||||
vgsplit -M$mdatype $vg1 $vg2 "$dev1"
|
||||
vgremove $vg1 $vg2
|
||||
|
||||
vgcreate -M$mdatype $vg2 $(cat DEVICES)
|
||||
vgcreate -M$mdatype "$vg2" "${DEVICES[@]}"
|
||||
vgsplit -M$mdatype $vg2 $vg1 "$dev1"
|
||||
vgremove $vg1 $vg2
|
||||
|
||||
# vgsplit accepts new vg as destination of split
|
||||
# lvm1 -- bz244792
|
||||
vgcreate -M$mdatype $vg1 $(cat DEVICES)
|
||||
vgcreate -M$mdatype "$vg1" "${DEVICES[@]}"
|
||||
vgsplit $vg1 $vg2 "$dev1" 1>err
|
||||
grep "New volume group \"$vg2\" successfully split from \"$vg1\"" err
|
||||
vgremove $vg1 $vg2
|
||||
|
Loading…
Reference in New Issue
Block a user