mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
tests: fix exporting content of make vars
Further tune script, so it works correctly with usable and unusable thin tools.
This commit is contained in:
parent
f9725503f8
commit
93a07a1b84
@ -25,9 +25,10 @@ abs_top_builddir = "@abs_top_builddir@"
|
||||
abs_top_srcdir = "@abs_top_srcdir@"
|
||||
|
||||
LVM_TEST_RESULTS ?= results
|
||||
LVM_TEST_THIN_DUMP_CMD ?= "@THIN_DUMP_CMD@"
|
||||
LVM_TEST_THIN_CHECK_CMD ?= "@THIN_CHECK_CMD@"
|
||||
LVM_TEST_THIN_REPAIR_CMD ?= "@THIN_REPAIR_CMD@"
|
||||
export LVM_TEST_THIN_CHECK_CMD?=@THIN_CHECK_CMD@
|
||||
export LVM_TEST_THIN_DUMP_CMD?=@THIN_DUMP_CMD@
|
||||
export LVM_TEST_THIN_REPAIR_CMD?=@THIN_REPAIR_CMD@
|
||||
|
||||
SUBDIRS = api unit
|
||||
SOURCES = lib/not.c lib/harness.c
|
||||
|
||||
|
@ -14,18 +14,14 @@
|
||||
|
||||
. lib/test
|
||||
|
||||
# Set tools from configuration (set by Makefile)
|
||||
# Allow user override to take tools from unusual places
|
||||
LVM_TEST_THIN_CHECK_CMD=${LVM_TEST_THIN_CHECK_CMD:-thin_check}
|
||||
LVM_TEST_THIN_DUMP_CMD=${LVM_TEST_THIN_DUMP_CMD:-thin_dump}
|
||||
LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD:-thin_repair}
|
||||
|
||||
which mkfs.ext2 || skip
|
||||
|
||||
# Maybe check also version of the tools here??
|
||||
which $LVM_TEST_THIN_CHECK_CMD || skip
|
||||
which $LVM_TEST_THIN_DUMP_CMD || skip
|
||||
which $LVM_TEST_THIN_REPAIR_CMD || skip
|
||||
# By default use tools from configuration (exported through Makefile)
|
||||
# Allow user to override location of binaries to take tools from different laces
|
||||
# Maybe check also version of the tools here?
|
||||
test -n "$LVM_TEST_THIN_CHECK_CMD" || LVM_TEST_THIN_CHECK_CMD=$(which thin_check) || skip
|
||||
test -n "$LVM_TEST_THIN_DUMP_CMD" || LVM_TEST_THIN_DUMP_CMD=$(which thin_dump) || skip
|
||||
test -n "$LVM_TEST_THIN_REPAIR_CMD" || LVM_TEST_THIN_REPAIR_CMD=$(which thin_repair) || skip
|
||||
|
||||
#
|
||||
# Main
|
||||
@ -76,6 +72,8 @@ should not $LVM_TEST_THIN_DUMP_CMD $DM_DEV_DIR/$vg/repair | tee dump
|
||||
|
||||
should $LVM_TEST_THIN_REPAIR_CMD -i $DM_DEV_DIR/$vg/repair -o $DM_DEV_DIR/$vg/fixed
|
||||
|
||||
should $LVM_TEST_THIN_DUMP_CMD --repair $DM_DEV_DIR/$vg/repair | tee repaired_xml
|
||||
|
||||
should $LVM_TEST_THIN_CHECK_CMD $DM_DEV_DIR/$vg/fixed
|
||||
|
||||
# Swap repaired metadata back
|
||||
@ -90,13 +88,14 @@ dmsetup table
|
||||
dmsetup info -c
|
||||
dmsetup ls --tree
|
||||
|
||||
# Currently in troubles - we can't remove thin volume from broken pool
|
||||
lvchange -an $vg/repair
|
||||
lvchange -an $vg/fixed
|
||||
lvchange -an $vg/pool_tmeta0
|
||||
dmsetup remove $vg-pool_tdata
|
||||
dmsetup remove $vg-pool_tmeta
|
||||
lvchange -an $vg
|
||||
|
||||
# FIXME: Currently in deep troubles - we can't remove thin volume from broken pool
|
||||
should lvremove -ff $vg
|
||||
|
||||
# let's not block PVs with openned _tdata/_tmeta devices
|
||||
dmsetup remove $vg-pool_tdata || true
|
||||
dmsetup remove $vg-pool_tmeta || true
|
||||
|
||||
dmsetup table
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user