1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-25 18:50:51 +03:00

tests: add have_cache and have_raid

Need to be aware of build options, when system would be
configure without raid or cache support
This commit is contained in:
Zdenek Kabelac 2014-05-20 19:54:48 +02:00
parent 7f92c3a13e
commit 2e9792121f
24 changed files with 41 additions and 29 deletions

View File

@ -146,6 +146,8 @@ lib/paths: $(srcdir)/Makefile.in .lib-dir-stamp
echo 'abs_builddir="$(abs_builddir)"' >> $@-t
echo 'export DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t
echo 'export THIN=@THIN@' >> $@-t
echo 'export RAID=@RAID@' >> $@-t
echo 'export CACHE=@CACHE@' >> $@-t
echo 'export LVMETAD_PIDFILE="@LVMETAD_PIDFILE@"' >> $@-t
echo 'export DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@-t
echo 'export CLVMD_PIDFILE="@CLVMD_PIDFILE@"' >> $@-t

View File

@ -770,13 +770,23 @@ target_at_least() {
}
have_thin() {
target_at_least dm-thin-pool "$@" || exit 1
test "$THIN" = shared || test "$THIN" = internal || exit 1
test "$THIN" = shared -o "$THIN" = internal || return 1
target_at_least dm-thin-pool "$@" || return 1
# disable thin_check if not present in system
which thin_check || lvmconf 'global/thin_check_executable = ""'
}
have_raid() {
test "$RAID" = shared -o "$RAID" = internal || return 1
target_at_least dm-raid "$@"
}
have_cache() {
test "$CACHE" = shared -o "$CACHE" = internal || return 1
target_at_least dm-cache "$@"
}
# check if lvm shell is build-in (needs readline)
have_readline() {
echo version | lvm &>/dev/null

View File

@ -11,7 +11,7 @@
. lib/test
aux target_at_least dm-raid 1 3 2 || skip
aux have_raid 1 3 2 || skip
aux prepare_vg 4

View File

@ -15,7 +15,7 @@
aux prepare_vg 4
TYPE=raid1
aux target_at_least dm-raid 1 1 0 || TYPE=mirror
aux have_raid 1 1 0 || TYPE=mirror
lvcreate -aey --type $TYPE -m 1 -l 2 -n $lv1 $vg
lvchange -an $vg/$lv1

View File

@ -17,9 +17,9 @@
# Proper mismatch count 1.5.2 upstream,1.3.5 < x < 1.4.0 in RHEL6
#
# We will simplify and simple test for 1.5.2 and 1.3.5 < x < 1.4.0
aux target_at_least dm-raid 1 3 5 &&
! aux target_at_least dm-raid 1 4 0 ||
aux target_at_least dm-raid 1 5 2 || skip
aux have_raid 1 3 5 &&
! aux have_raid 1 4 0 ||
aux have_raid 1 5 2 || skip
# DEVICE "$dev6" is reserved for non-RAID LVs that
# will not undergo failure

View File

@ -13,7 +13,7 @@ TEST_RAID=raid10
. shell/lvchange-raid.sh
aux target_at_least dm-raid 1 5 2 || skip
aux have_raid 1 5 2 || skip
run_types raid10 -m 1 -i 2 "$dev1" "$dev2" "$dev3" "$dev4"

View File

@ -14,7 +14,7 @@ TEST_RAID=raid456
. shell/lvchange-raid.sh
aux raid456_replace_works || skip
aux target_at_least dm-raid 1 5 2 || skip
aux have_raid 1 5 2 || skip
run_types raid4 -i 2 "$dev1" "$dev2" "$dev3" "$dev4"
run_types raid5 -i 2 "$dev1" "$dev2" "$dev3" "$dev4"

View File

@ -22,7 +22,7 @@ get_image_pvs() {
########################################################
# MAIN
########################################################
aux target_at_least dm-raid 1 2 0 || skip
aux have_raid 1 2 0 || skip
aux prepare_pvs 5
vgcreate -s 256k $vg $(cat DEVICES)

View File

@ -24,7 +24,7 @@ get_image_pvs() {
########################################################
# RAID10: Can replace 'copies - 1' devices from each stripe
# Tests are run on 2-way mirror, 3-way stripe RAID10
aux target_at_least dm-raid 1 3 1 || skip
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

View File

@ -23,7 +23,7 @@ get_image_pvs() {
# MAIN
########################################################
aux raid456_replace_works || skip
aux target_at_least dm-raid 1 2 0 || skip
aux have_raid 1 2 0 || skip
aux prepare_pvs 6
vgcreate -s 256k $vg $(cat DEVICES)

View File

@ -12,7 +12,7 @@
. lib/test
aux raid456_replace_works || skip
aux target_at_least dm-raid 1 1 0 || skip
aux have_raid 1 1 0 || skip
aux lvmconf 'allocation/maximise_cling = 0'
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'

View File

@ -157,7 +157,7 @@ lvremove -ff $vg
# Test conversion to the pool and thin external at the same time (rhbz #1003461)
lvcreate -l50 -n pool $vg
lvcreate -l100 -n thin $vg
lvconvert --thin --thinpool $vg/pool $vg/thin --originname thin-origin
lvconvert --yes --thin --thinpool $vg/pool $vg/thin --originname thin-origin
check lv_field $vg/thin segtype thin
check lv_field $vg/thin-origin segtype linear

View File

@ -11,7 +11,7 @@
. lib/test
aux target_at_least dm-cache 1 3 0 || skip
aux have_cache 1 3 0 || skip
aux prepare_vg 5 80

View File

@ -16,7 +16,7 @@
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
aux target_at_least dm-raid 1 1 0 || skip
aux have_raid 1 1 0 || skip
aux prepare_vg 5

View File

@ -16,7 +16,7 @@
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
aux target_at_least dm-raid 1 3 0 || skip
aux have_raid 1 3 0 || skip
aux prepare_vg 5

View File

@ -18,7 +18,7 @@ lv_devices() {
########################################################
# MAIN
########################################################
aux target_at_least dm-raid 1 1 0 || skip
aux have_raid 1 1 0 || skip
aux prepare_pvs 6 20 # 6 devices for RAID10 (2-mirror,3-stripe) test
vgcreate -s 512k $vg $(cat DEVICES)

View File

@ -18,7 +18,7 @@ lv_devices() {
########################################################
# MAIN
########################################################
aux target_at_least dm-raid 1 3 0 || skip
aux have_raid 1 3 0 || skip
aux prepare_pvs 6 20 # 6 devices for RAID10 (2-mirror,3-stripe) test
vgcreate -s 512k $vg $(cat DEVICES)

View File

@ -11,7 +11,7 @@
. lib/test
aux target_at_least dm-raid 1 1 0 || skip
aux have_raid 1 1 0 || skip
aux prepare_pvs 6 80

View File

@ -11,7 +11,7 @@
. lib/test
aux target_at_least dm-raid 1 3 0 || skip
aux have_raid 1 3 0 || skip
aux prepare_vg 5

View File

@ -22,10 +22,10 @@ test_description="ensure pvmove works with the cache segment types"
test -e LOCAL_CLVMD && skip
which md5sum || skip
aux target_at_least dm-cache 1 3 0 || skip
aux have_cache 1 3 0 || skip
# for stacking
aux target_at_least dm-thin-pool 1 8 0 || skip
aux target_at_least dm-raid 1 4 2 || skip
aux have_thin 1 8 0 || skip
aux have_raid 1 4 2 || skip
aux prepare_vg 5 80

View File

@ -16,7 +16,7 @@ test_description="ensure pvmove works with raid segment types"
test -e LOCAL_CLVMD && skip
which md5sum || skip
aux target_at_least dm-raid 1 3 5 || skip
aux have_raid 1 3 5 || skip
aux prepare_pvs 5 20
vgcreate -c n -s 128k $vg $(cat DEVICES)

View File

@ -15,9 +15,9 @@ test_description="ensure pvmove works with thin segment types"
test -e LOCAL_CLVMD && skip
which md5sum || skip
aux target_at_least dm-thin-pool 1 8 0 || skip
aux have_thin 1 8 0 || skip
# for stacking
aux target_at_least dm-raid 1 3 5 || skip
aux have_raid 1 3 5 || skip
aux prepare_pvs 5 20
vgcreate -c n -s 128k $vg $(cat DEVICES)

View File

@ -16,7 +16,7 @@
aux prepare_vg
aux target_at_least dm-thin-pool 1 8 0 || skip
aux have_thin 1 8 0 || skip
aux extend_filter_LVMTEST

View File

@ -21,7 +21,7 @@ create_vg_() {
vgcreate -s 64k "$@"
}
aux target_at_least dm-raid 1 1 0 || skip
aux have_raid 1 1 0 || skip
aux prepare_pvs 5 10