All of lore.kernel.org
 help / color / mirror / Atom feed
* master - tests: integrate default thin/cache tool paths
@ 2015-04-14  8:12 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2015-04-14  8:12 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a084b3122f5df4d9dcd244762132abcb5f46ea6a
Commit:        a084b3122f5df4d9dcd244762132abcb5f46ea6a
Parent:        c6bcfcba8541d053f142496c30f437a694daf5ee
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Apr 14 10:08:57 2015 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Apr 14 10:11:36 2015 +0200

tests: integrate default thin/cache tool paths

If the system is correctly configure (cache & thin tools are present)
avoid 'extra' rebuild of configuration.

On the other hand - if some tool is missing - duplicate ##LVMCONF should
make it more straighforward to see.
---
 test/lib/aux.sh |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index bccc30c..8e729a7 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -690,6 +690,12 @@ global/locking_dir = "$TESTDIR/var/lock/lvm"
 global/locking_type=$LVM_TEST_LOCKING
 global/si_unit_consistency = 1
 global/fallback_to_local_locking = 0
+global/cache_check_executable = "$LVM_TEST_CACHE_CHECK_CMD"
+global/cache_dump_executable = "$LVM_TEST_CACHE_DUMP_CMD"
+global/cache_repair_executable = "$LVM_TEST_CACHE_REPAIR_CMD"
+global/thin_check_executable = "$LVM_TEST_THIN_CHECK_CMD"
+global/thin_dump_executable = "$LVM_TEST_THIN_DUMP_CMD"
+global/thin_repair_executable = "$LVM_TEST_THIN_REPAIR_CMD"
 activation/checks = 1
 activation/udev_sync = 1
 activation/udev_rules = 1
@@ -887,9 +893,13 @@ have_thin() {
 	test -x "$LVM_TEST_THIN_CHECK_CMD" || LVM_TEST_THIN_CHECK_CMD=""
 	test -x "$LVM_TEST_THIN_DUMP_CMD" || LVM_TEST_THIN_DUMP_CMD=""
 	test -x "$LVM_TEST_THIN_REPAIR_CMD" || LVM_TEST_THIN_REPAIR_CMD=""
+	test -z "$LVM_TEST_THIN_CHECK_CMD" -o \
+	     -z "$LVM_TEST_THIN_DUMP_CMD" -o \
+	     -z "$LVM_TEST_THIN_REPAIR_CMD" && {
 	lvmconf "global/thin_check_executable = \"$LVM_TEST_THIN_CHECK_CMD\"" \
 		"global/thin_dump_executable = \"$LVM_TEST_THIN_DUMP_CMD\"" \
 		"global/thin_repair_executable = \"$LVM_TEST_THIN_REPAIR_CMD\""
+	}
 }
 
 have_raid() {
@@ -901,12 +911,17 @@ have_cache() {
 	test "$CACHE" = shared -o "$CACHE" = internal || return 1
 	target_at_least dm-cache "$@"
 
+	# disable cache_check if not present in system
 	test -x "$LVM_TEST_CACHE_CHECK_CMD" || LVM_TEST_CACHE_CHECK_CMD=""
 	test -x "$LVM_TEST_CACHE_DUMP_CMD" || LVM_TEST_CACHE_DUMP_CMD=""
 	test -x "$LVM_TEST_CACHE_REPAIR_CMD" || LVM_TEST_CACHE_REPAIR_CMD=""
+	test -z "$LVM_TEST_CACHE_CHECK_CMD" -o \
+	     -z "$LVM_TEST_CACHE_DUMP_CMD" -o \
+	     -z "$LVM_TEST_CACHE_REPAIR_CMD" && {
 	lvmconf "global/cache_check_executable = \"$LVM_TEST_CACHE_CHECK_CMD\"" \
 		"global/cache_dump_executable = \"$LVM_TEST_CACHE_DUMP_CMD\"" \
 		"global/cache_repair_executable = \"$LVM_TEST_CACHE_REPAIR_CMD\""
+	}
 }
 
 have_tool_at_least() {



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-14  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14  8:12 master - tests: integrate default thin/cache tool paths Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.