From 6e523f01d07d7d819c2f0d9b1595e628ddffea24 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Wed, 10 Oct 2012 00:20:22 +0200 Subject: [PATCH] test: Skip thin tests if thin support is configured out. --- test/Makefile.in | 1 + test/api/thin_percent.sh | 2 +- test/lib/aux.sh | 6 ++++++ test/shell/discards-thin.sh | 2 +- test/shell/lvconvert-thin.sh | 2 +- test/shell/lvcreate-thin-snap.sh | 2 +- test/shell/lvcreate-thin.sh | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index da97f2c45..6d7ee2cb6 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -98,6 +98,7 @@ lib/paths: $(srcdir)/Makefile.in .lib-dir-stamp echo 'abs_srcdir=$(abs_srcdir)' >> $@-t echo 'abs_builddir=$(abs_builddir)' >> $@-t echo 'export DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t + echo 'export THIN=@THIN@' >> $@-t mv $@-t $@ LIB = lib/not lib/should lib/harness \ diff --git a/test/api/thin_percent.sh b/test/api/thin_percent.sh index bba33ba8a..9287cf343 100644 --- a/test/api/thin_percent.sh +++ b/test/api/thin_percent.sh @@ -13,7 +13,7 @@ . lib/test -aux target_at_least dm-thin-pool 1 0 0 || skip +aux have_thin 1 0 0 || skip # disable thin_check if not present in system which thin_check || aux lvmconf 'global/thin_check_executable = ""' diff --git a/test/lib/aux.sh b/test/lib/aux.sh index 6cfd6db2a..d972d10f6 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -530,6 +530,12 @@ target_at_least() test "$revision" -ge "$3" 2>/dev/null || return 1 } +have_thin() +{ + target_at_least dm-thin-pool "$@" || exit 1 + test "$THIN" = shared || test "$THIN" = internal || exit 1 +} + test -f DEVICES && devs=$(cat DEVICES) #unset LVM_VALGRIND diff --git a/test/shell/discards-thin.sh b/test/shell/discards-thin.sh index 28300d981..ec3bd1f8b 100644 --- a/test/shell/discards-thin.sh +++ b/test/shell/discards-thin.sh @@ -18,7 +18,7 @@ # # Main # -aux target_at_least dm-thin-pool 1 1 0 || skip +aux have_thin 1 1 0 || skip aux prepare_pvs 2 64 diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh index 3ad324892..abaa620cb 100644 --- a/test/shell/lvconvert-thin.sh +++ b/test/shell/lvconvert-thin.sh @@ -15,7 +15,7 @@ # # Main # -aux target_at_least dm-thin-pool 1 0 0 || skip +aux have_thin 1 0 0 || skip aux prepare_pvs 4 64 diff --git a/test/shell/lvcreate-thin-snap.sh b/test/shell/lvcreate-thin-snap.sh index 0e91222e2..2ee8748eb 100644 --- a/test/shell/lvcreate-thin-snap.sh +++ b/test/shell/lvcreate-thin-snap.sh @@ -26,7 +26,7 @@ check_lv_field_modules_() # # Main # -aux target_at_least dm-thin-pool 1 0 0 || skip +aux have_thin 1 0 0 || skip aux prepare_pvs 2 64 diff --git a/test/shell/lvcreate-thin.sh b/test/shell/lvcreate-thin.sh index 32ffef840..7ba97ed0e 100644 --- a/test/shell/lvcreate-thin.sh +++ b/test/shell/lvcreate-thin.sh @@ -29,7 +29,7 @@ check_lv_field_modules_() # # Main # -aux target_at_least dm-thin-pool 1 0 0 || skip +aux have_thin 1 0 0 || skip aux prepare_pvs 2 64 -- 2.43.5