master - tests: add have_cache and have_raid
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2e9792121fa93e7cb67583cd2757dd52ab2825dc Commit: 2e9792121fa93e7cb67583cd2757dd52ab2825dc Parent: 7f92c3a13eeba179872dacd4b632d8bb5188a0ba Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue May 20 19:54:48 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue May 20 21:50:30 2014 +0200
tests: add have_cache and have_raid
Need to be aware of build options, when system would be configure without raid or cache support
--- test/Makefile.in | 2 ++ test/lib/aux.sh | 14 ++++++++++++-- test/shell/lvchange-partial-raid10.sh | 2 +- test/shell/lvchange-partial.sh | 2 +- test/shell/lvchange-raid.sh | 6 +++--- test/shell/lvchange-raid10.sh | 2 +- test/shell/lvchange-raid456.sh | 2 +- test/shell/lvconvert-raid.sh | 2 +- test/shell/lvconvert-raid10.sh | 2 +- test/shell/lvconvert-raid456.sh | 2 +- test/shell/lvconvert-repair-raid.sh | 2 +- test/shell/lvconvert-thin-external.sh | 2 +- test/shell/lvcreate-cache.sh | 2 +- test/shell/lvcreate-large-raid.sh | 2 +- test/shell/lvcreate-large-raid10.sh | 2 +- test/shell/lvcreate-raid.sh | 2 +- test/shell/lvcreate-raid10.sh | 2 +- test/shell/lvresize-raid.sh | 2 +- test/shell/lvresize-raid10.sh | 2 +- test/shell/pvmove-cache-segtypes.sh | 6 +++--- test/shell/pvmove-raid-segtypes.sh | 2 +- test/shell/pvmove-thin-segtypes.sh | 4 ++-- test/shell/pvremove-thin.sh | 2 +- test/shell/vgsplit-raid.sh | 2 +- 24 files changed, 41 insertions(+), 29 deletions(-)
test/Makefile.in +2 -0
@@ -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
test/lib/aux.sh +12 -2
@@ -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
test/shell/lvchange-partial-raid10.sh +1 -1
@@ -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
test/shell/lvchange-partial.sh +1 -1
@@ -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
test/shell/lvchange-raid.sh +3 -3
@@ -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
test/shell/lvchange-raid10.sh +1 -1
@@ -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"
test/shell/lvchange-raid456.sh +1 -1
@@ -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"
test/shell/lvconvert-raid.sh +1 -1
@@ -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)
test/shell/lvconvert-raid10.sh +1 -1
@@ -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
test/shell/lvconvert-raid456.sh +1 -1
@@ -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)
test/shell/lvconvert-repair-raid.sh +1 -1
@@ -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'
test/shell/lvconvert-thin-external.sh +1 -1
@@ -157,7 +157,7 @@ lvremove -ff $vg # Test conversion to the pool and thin external@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
test/shell/lvcreate-cache.sh +1 -1
@@ -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
test/shell/lvcreate-large-raid.sh +1 -1
@@ -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
test/shell/lvcreate-large-raid10.sh +1 -1
@@ -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
test/shell/lvcreate-raid.sh +1 -1
@@ -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)
test/shell/lvcreate-raid10.sh +1 -1
@@ -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)
test/shell/lvresize-raid.sh +1 -1
@@ -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
test/shell/lvresize-raid10.sh +1 -1
@@ -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
test/shell/pvmove-cache-segtypes.sh +3 -3
@@ -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
test/shell/pvmove-raid-segtypes.sh +1 -1
@@ -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)
test/shell/pvmove-thin-segtypes.sh +2 -2
@@ -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)
test/shell/pvremove-thin.sh +1 -1
@@ -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
test/shell/vgsplit-raid.sh +1 -1
@@ -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