2015-05-11 22:47:39 +03:00
# Copyright (C) 2007-2015 Red Hat, Inc. All rights reserved.
2007-09-18 18:02:22 +04:00
#
# This file is part of LVM2.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2007-09-18 18:02:22 +04:00
2007-09-18 18:00:42 +04:00
#TEST_OPTS=--verbose --debug
SHELL_PATH ?= $( SHELL)
RM ?= rm -f
2011-11-23 16:21:41 +04:00
subdir = $( shell pwd| sed 's,.*/,,' )
2007-09-18 18:00:42 +04:00
2007-09-18 18:02:22 +04:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
2014-03-14 17:10:29 +04:00
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
2015-02-05 18:30:50 +03:00
datarootdir = @datarootdir@
2011-11-23 16:21:41 +04:00
2013-06-03 14:07:31 +04:00
LVM_TEST_RESULTS ?= results
2014-11-17 02:41:33 +03:00
2018-06-08 13:37:57 +03:00
# FIXME: resolve testing of: unit
2018-11-17 00:15:23 +03:00
SOURCES = lib/not.c lib/harness.c lib/dmsecuretest.c
2014-06-08 20:24:33 +04:00
CXXSOURCES = lib/runner.cpp
2015-09-04 17:34:34 +03:00
CXXFLAGS += $( EXTRA_EXEC_CFLAGS)
2011-11-23 16:21:41 +04:00
2018-05-18 17:15:25 +03:00
CLEAN_DIRS += dbus/__pycache__ $( LVM_TEST_RESULTS)
i f n e q ( . , $( firstword $ ( srcdir ) ) )
2018-06-22 23:43:58 +03:00
CLEAN_TARGETS += $( RUN_BASE) $( addprefix lib/,$( LIB_LVMLOCKD_CONF) $( LIB_MKE2FS_CONF) )
2018-05-18 17:15:25 +03:00
e n d i f
CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $( LIB) $( addprefix lib/,\
2018-07-10 22:40:48 +03:00
$( CMDS) clvmd dmeventd dmsetup dmstats lvmpolld \
2018-05-18 17:15:25 +03:00
harness lvmdbusd.profile thin-performance.profile fsadm \
dm-version-expected version-expected \
paths-installed paths-installed-t paths-common paths-common-t)
2011-01-13 17:58:59 +03:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2007-09-18 18:00:42 +04:00
2010-04-13 10:45:53 +04:00
T ?= .
2010-10-12 20:17:25 +04:00
S ?= @ # never match anything by default
2010-10-14 18:36:26 +04:00
VERBOSE ?= 0
2019-05-30 19:02:55 +03:00
ALL := $( shell find -L $( srcdir) \( -path \* /shell/\* .sh -or -path \* /api/\* .sh -or -path \* /unit/\* .sh \) | $( SORT) )
2013-10-09 16:02:34 +04:00
comma = ,
2019-05-30 19:02:55 +03:00
RUN := $( shell find -L $( srcdir) -regextype posix-egrep \( -path \* /shell/\* .sh -or -path \* /api/\* .sh -or -path \* /unit/\* .sh \) -and -regex " $( srcdir) /.*( $( subst $( comma) ,| ,$( T) ) ).* " -and -not -regex " $( srcdir) /.*( $( subst $( comma) ,| ,$( S) ) ).* " | $( SORT) )
2011-09-25 01:10:19 +04:00
RUN_BASE = $( subst $( srcdir) /,,$( RUN) )
2010-04-13 10:45:53 +04:00
2015-05-09 02:59:18 +03:00
i f e q ( "@BUILD_LVMPOLLD@" , "yes" )
LVMPOLLD_RUN_BASE = $( RUN_BASE)
2018-07-10 22:40:48 +03:00
LVMPOLLD_NDEV_FLAVOUR = ,ndev-lvmpolld
LVMPOLLD_UDEV_FLAVOUR = ,udev-lvmpolld
2015-05-09 02:59:18 +03:00
e n d i f
2013-12-05 15:31:49 +04:00
2016-02-24 01:34:46 +03:00
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
LVMLOCKD_RUN_BASE = $( RUN_BASE)
LVMLOCKD_UDEV_FLAVOUR = ,udev-lvmlockd-test
e n d i f
2009-11-30 17:59:26 +03:00
# Shell quote;
2015-05-18 11:27:15 +03:00
SHELL_PATH_SQ := $( subst ',' \' ' ,$( SHELL_PATH) )
2009-11-30 17:59:26 +03:00
2010-01-11 18:48:49 +03:00
i f e q ( "@UDEV_SYNC@" , "yes" )
2010-02-15 19:30:13 +03:00
dm_udev_synchronisation = 1
2010-01-11 18:48:49 +03:00
e n d i f
2014-06-27 03:00:37 +04:00
all : .tests -stamp
2011-09-25 01:10:19 +04:00
2012-03-28 15:10:08 +04:00
help :
@echo -e "\nAvailable targets:"
@echo " all Default target, run check."
@echo " check Run all tests."
2015-07-30 21:23:14 +03:00
@echo " check_system Run all tests using udev."
2018-07-10 22:40:48 +03:00
@echo " check_local Run tests."
2015-05-09 02:59:18 +03:00
@echo " check_lvmpolld Run tests with lvmpolld daemon."
2016-10-17 12:13:43 +03:00
@echo " check_all_lvmpolld Run all tests with lvmpolld daemon."
2015-03-05 23:00:44 +03:00
@echo " check_lvmlockd_sanlock Run tests with lvmlockd and sanlock."
@echo " check_lvmlockd_dlm Run tests with lvmlockd and dlm."
2016-01-15 01:12:46 +03:00
@echo " check_lvmlockd_test Run tests with lvmlockd --test."
2018-05-12 19:14:53 +03:00
@echo " run-unit-test Run only unit tests (root not needed)."
2012-03-28 15:10:08 +04:00
@echo " clean Clean dir."
@echo " help Display callable targets."
@echo -e "\nSupported variables:"
2016-04-21 00:18:51 +03:00
@echo " LVM_TEST_AUX_TRACE Set for verbose messages for aux scripts []."
2015-04-28 12:35:56 +03:00
@echo " LVM_TEST_BACKING_DEVICE Set device used for testing (see also LVM_TEST_DIR)."
2014-03-14 17:10:29 +04:00
@echo " LVM_TEST_CAN_CLOBBER_DMESG Allow to clobber dmesg buffer without /dev/kmsg. (1)"
2012-03-28 15:10:08 +04:00
@echo " LVM_TEST_DEVDIR Set to '/dev' to run on real /dev."
2018-05-07 12:35:35 +03:00
@echo " LVM_TEST_PREFER_BRD Prefer using brd (ramdisk) over loop for testing [1]."
2014-05-27 01:28:03 +04:00
@echo " LVM_TEST_DIR Where to create test files [ $( LVM_TEST_DIR) ]. "
2012-03-28 15:10:08 +04:00
@echo " LVM_TEST_LOCKING Normal (1), Cluster (3)."
2015-05-09 02:59:18 +03:00
@echo " LVM_TEST_LVMPOLLD Start lvmpolld"
2012-03-28 15:10:08 +04:00
@echo " LVM_TEST_NODEBUG Do not debug lvm commands."
@echo " LVM_TEST_PARALLEL May skip agresive wipe of LVMTEST resources."
2013-06-03 14:07:31 +04:00
@echo " LVM_TEST_RESULTS Where to create result files [results]."
2014-05-27 01:28:03 +04:00
@echo " LVM_TEST_THIN_CHECK_CMD Command for thin_check [ $( LVM_TEST_THIN_CHECK_CMD) ]. "
@echo " LVM_TEST_THIN_DUMP_CMD Command for thin_dump [ $( LVM_TEST_THIN_DUMP_CMD) ]. "
@echo " LVM_TEST_THIN_REPAIR_CMD Command for thin_repair [ $( LVM_TEST_THIN_REPAIR_CMD) ]. "
@echo " LVM_TEST_THIN_RESTORE_CMD Command for thin_restore [ $( LVM_TEST_THIN_RESTORE_CMD) ]. "
2014-11-17 02:41:33 +03:00
@echo " LVM_TEST_CACHE_CHECK_CMD Command for cache_check [ $( LVM_TEST_CACHE_CHECK_CMD) ]. "
@echo " LVM_TEST_CACHE_DUMP_CMD Command for cache_dump [ $( LVM_TEST_CACHE_DUMP_CMD) ]. "
@echo " LVM_TEST_CACHE_REPAIR_CMD Command for cache_repair [ $( LVM_TEST_CACHE_REPAIR_CMD) ]. "
@echo " LVM_TEST_CACHE_RESTORE_CMD Command for cache_restore [ $( LVM_TEST_CACHE_RESTORE_CMD) ]. "
2013-06-09 00:23:39 +04:00
@echo " LVM_TEST_UNLIMITED Set to get unlimited test log (>32MB)"
2015-04-14 10:45:36 +03:00
@echo " LVM_VALGRIND Enable valgrind testing, execs $$ " VALGRIND.
2014-03-14 17:10:29 +04:00
@echo " LVM_VALGRIND_DMEVENTD Enable valgrind testing of dmeventd (1)."
2015-04-14 10:45:36 +03:00
@echo " LVM_STRACE Enable strace logging."
@echo " LVM_DEBUG_LEVEL Sets debuging level for valgrind/strace (use > 0)."
2012-03-28 15:10:08 +04:00
@echo " LVM_VERIFY_UDEV Default verify state for lvm.conf."
2017-10-26 14:57:51 +03:00
@echo " LVM_LOG_FILE_MAX_LINES Maximum number of logged lines for lvm2 command [1000000]."
@echo " S Skip given test(s) (regex)."
@echo " T Run given test(s) (regex)."
2012-03-28 15:10:08 +04:00
@echo " VERBOSE Verbose output (1), timing (2)."
2013-05-27 05:12:03 +04:00
check : .tests -stamp
2014-06-27 03:00:37 +04:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 23:11:09 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-26 15:56:08 +03:00
--flavours ndev-vanilla$( LVMPOLLD_NDEV_FLAVOUR) --only $( T) --skip $( S)
2008-09-29 20:07:02 +04:00
2013-12-15 20:26:28 +04:00
check_system : .tests -stamp
2014-06-27 03:00:37 +04:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 23:11:09 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-26 15:56:08 +03:00
--flavours udev-vanilla$( LVMPOLLD_UDEV_FLAVOUR) $( LVMLOCKD_UDEV_FLAVOUR) --only $( T) --skip $( S)
2010-04-13 17:28:52 +04:00
2011-01-05 03:16:18 +03:00
check_local : .tests -stamp
2014-06-27 03:00:37 +04:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 23:11:09 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2014-09-14 13:11:12 +04:00
--flavours ndev-vanilla --only $( T) --skip $( S)
2010-04-13 17:28:52 +04:00
2015-05-09 02:59:18 +03:00
i f e q ( "@BUILD_LVMPOLLD@" , "yes" )
check_lvmpolld : .tests -stamp
2016-10-17 12:13:43 +03:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 12:01:21 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-10-17 12:13:43 +03:00
--flavours ndev-lvmpolld --only $( T) --skip $( S)
check_all_lvmpolld : .tests -stamp
2015-05-09 02:59:18 +03:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 12:01:21 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-10 22:40:48 +03:00
--flavours ndev-lvmpolld --only $( T) --skip $( S)
2015-05-09 02:59:18 +03:00
e n d i f
2015-03-05 23:00:44 +03:00
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
check_lvmlockd_sanlock : .tests -stamp
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 12:01:21 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-01-15 01:12:46 +03:00
--flavours udev-lvmlockd-sanlock --only shell/aa-lvmlockd-sanlock-prepare.sh,$( T) ,shell/zz-lvmlockd-sanlock-remove.sh --skip $( S)
2015-03-05 23:00:44 +03:00
e n d i f
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
check_lvmlockd_dlm : .tests -stamp
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 12:01:21 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-01-15 01:12:46 +03:00
--flavours udev-lvmlockd-dlm --only shell/aa-lvmlockd-dlm-prepare.sh,$( T) ,shell/zz-lvmlockd-dlm-remove.sh --skip $( S)
e n d i f
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
check_lvmlockd_test : .tests -stamp
2015-03-05 23:00:44 +03:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 12:01:21 +03:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-02-23 22:58:22 +03:00
--flavours udev-lvmlockd-test --only $( T) --skip $( S)
2015-03-05 23:00:44 +03:00
e n d i f
2018-05-12 19:14:53 +03:00
run-unit-test unit-test :
2018-11-29 19:09:27 +03:00
@echo " [MAKE] $< "
2018-12-01 02:44:22 +03:00
$( Q) $( MAKE) -C $( top_builddir) $( @)
2018-05-12 19:14:53 +03:00
2014-06-27 03:00:37 +04:00
DATADIR = $( datadir) /lvm2-testsuite
EXECDIR = $( libexecdir) /lvm2-testsuite
2015-05-11 18:30:23 +03:00
LIB_FLAVOURS = \
2015-09-04 17:34:34 +03:00
flavour-ndev-lvmpolld\
flavour-ndev-vanilla\
flavour-udev-lvmpolld\
flavour-udev-lvmlockd-sanlock\
flavour-udev-lvmlockd-dlm\
2016-01-15 01:12:46 +03:00
flavour-udev-lvmlockd-test\
2015-09-04 17:34:34 +03:00
flavour-udev-vanilla
LIB_LVMLOCKD_CONF = \
test-corosync-conf \
test-dlm-conf \
test-sanlock-conf
2018-06-22 23:43:58 +03:00
LIB_MKE2FS_CONF = \
mke2fs.conf
2018-11-17 00:15:23 +03:00
LIB_SECURETEST = securetest
LIB_DMSECURETEST = dmsecuretest
2018-06-22 23:43:58 +03:00
LIB_LOCAL = paths runner
2015-09-04 17:34:34 +03:00
LIB_NOT = not
LIB_LINK_NOT = invalid fail should
LIB_SHARED = check aux inittest utils get lvm-wrapper
2014-06-27 03:00:37 +04:00
2015-12-11 16:17:08 +03:00
install : .tests -stamp lib /paths -installed
2014-06-27 03:00:37 +04:00
@echo $( srcdir)
2019-05-30 19:02:55 +03:00
$( Q) $( INSTALL_DIR) $( DATADIR) /{ shell,api,unit,lib,dbus} $( EXECDIR)
2018-11-29 19:09:27 +03:00
$( Q) $( INSTALL_DATA) shell/*.sh $( DATADIR) /shell
2019-05-30 19:02:55 +03:00
$( INSTALL_DATA) api/*.sh $( DATADIR) /api
2018-11-29 19:09:27 +03:00
$( Q) $( INSTALL_DATA) unit/*.sh $( DATADIR) /unit
-$( Q) $( INSTALL_PROGRAM) unit/unit-test $( DATADIR) /unit
-$( Q) $( INSTALL_PROGRAM) dbus/*.py $( DATADIR) /dbus/
2014-06-27 03:00:37 +04:00
$( INSTALL_DATA) lib/paths-installed $( DATADIR) /lib/paths
2015-09-08 15:11:06 +03:00
cd lib && $( INSTALL_DATA) \
$( LIB_FLAVOURS) \
$( LIB_LVMLOCKD_CONF) \
2018-06-22 23:43:58 +03:00
$( LIB_MKE2FS_CONF) \
2016-03-01 18:03:02 +03:00
dm-version-expected \
version-expected \
$( DATADIR) /lib
2016-11-26 02:17:40 +03:00
@for i in cache-mq cache-smq thin-performance lvmdbusd ; do \
2015-09-04 17:34:34 +03:00
echo " $( INSTALL_DATA) $( abs_top_srcdir) /conf/ $$ i.profile $( DATADIR) /lib " ; \
$( INSTALL_DATA) $( abs_top_srcdir) /conf/$$ i.profile $( DATADIR) /lib; done
cd lib && $( INSTALL_SCRIPT) $( LIB_SHARED) $( DATADIR) /lib
@cd $( DATADIR) /lib && for i in $( CMDS) ; do \
echo " $( LN_S) -f lvm-wrapper $$ i " ; \
$( LN_S) -f lvm-wrapper $$ i; done
2018-11-17 00:15:23 +03:00
$( INSTALL_PROGRAM) lib/$( LIB_NOT) lib/$( LIB_SECURETEST) lib/$( LIB_DMSECURETEST) $( EXECDIR)
2015-09-04 17:34:34 +03:00
@cd $( EXECDIR) && for i in $( LIB_LINK_NOT) ; do \
echo " $( LN_S) -f not $$ i " ; \
$( LN_S) -f not $$ i; done
2018-11-29 19:09:27 +03:00
$( Q) $( INSTALL_PROGRAM) -D lib/runner $( bindir) /lvm2-testsuite
2014-06-27 03:00:37 +04:00
2011-01-05 03:16:18 +03:00
lib/should : lib /not
2018-11-29 19:09:27 +03:00
@echo " [LN] $@ "
$( Q) $( LN_S) -f not lib/should
2009-01-12 21:45:44 +03:00
2014-03-28 03:34:04 +04:00
lib/invalid : lib /not
2018-11-29 19:09:27 +03:00
@echo " [LN] $@ "
$( Q) $( LN_S) -f not lib/invalid
2014-03-28 03:34:04 +04:00
lib/fail : lib /not
2018-11-29 19:09:27 +03:00
@echo " [LN] $@ "
$( Q) $( LN_S) -f not lib/fail
2014-03-28 03:34:04 +04:00
2014-06-08 20:24:33 +04:00
lib/runner : lib /runner .o .lib -dir -stamp
2018-11-29 19:09:27 +03:00
@echo " [CXX] $@ "
$( Q) $( CXX) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -o $@ $<
2014-06-08 20:24:33 +04:00
2018-11-17 00:15:23 +03:00
lib/dmsecuretest : lib /dmsecuretest .o .lib -dir -stamp $( INTERNAL_LIBS )
2018-11-29 19:09:27 +03:00
@echo " [CC] $@ "
$( Q) $( CC) -g $( CFLAGS) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -o $@ $< $( INTERNAL_LIBS) $( LIBS)
2018-11-17 00:15:23 +03:00
lib/securetest : lib /dmsecuretest .o .lib -dir -stamp
2018-11-29 19:09:27 +03:00
@echo " [CC] $@ "
$( Q) $( CC) -g $( CFLAGS) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -o $@ $< -L$( top_builddir) /libdm/ioctl -ldevmapper $( LIBS)
2018-11-17 00:15:23 +03:00
2014-06-25 23:34:34 +04:00
lib/runner.o : $( wildcard $ ( srcdir ) /lib /*.h )
2015-09-04 17:34:34 +03:00
CFLAGS_runner.o += $( EXTRA_EXEC_CFLAGS)
2018-11-17 00:15:23 +03:00
CFLAGS_dmsecuretest.o += $( EXTRA_EXEC_CFLAGS)
2015-09-04 17:34:34 +03:00
2011-11-23 18:56:47 +04:00
lib/% : lib /%.o .lib -dir -stamp
2018-11-29 19:09:27 +03:00
@echo " [CC] $@ "
$( Q) $( CC) $( CFLAGS) $( LDFLAGS) $( ELDFLAGS) -o $@ $<
2009-02-12 22:54:45 +03:00
2011-01-05 03:16:18 +03:00
lib/% : $( srcdir ) /lib /%.sh .lib -dir -stamp
2018-11-29 19:09:27 +03:00
@echo " [CP] $@ "
$( Q) cp $< $@
$( Q) $( CHMOD) +x $@
2010-04-12 23:02:59 +04:00
2014-06-27 11:10:56 +04:00
lib/flavour-% : $( srcdir ) /lib /flavour -%.sh .lib -dir -stamp
2018-11-29 19:09:27 +03:00
@echo " [FLAVOUR] $< "
$( Q) cp $< $@
2014-06-27 03:00:37 +04:00
lib/paths-common : $( srcdir ) /Makefile .in .lib -dir -stamp Makefile
2018-11-29 19:09:27 +03:00
@echo " [PATHS] $@ "
$( Q) echo 'DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@ -t
$( Q) echo 'LVMPOLLD_PIDFILE="@LVMPOLLD_PIDFILE@"' >> $@ -t
$( Q) echo 'DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@ -t
$( Q) echo 'LVM_TEST_THIN_CHECK_CMD=$${LVM_TEST_THIN_CHECK_CMD-@THIN_CHECK_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_THIN_DUMP_CMD=$${LVM_TEST_THIN_DUMP_CMD-@THIN_DUMP_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_THIN_REPAIR_CMD=$${LVM_TEST_THIN_REPAIR_CMD-@THIN_REPAIR_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_THIN_RESTORE_CMD=$${LVM_TEST_THIN_RESTORE_CMD-@THIN_RESTORE_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_CACHE_CHECK_CMD=$${LVM_TEST_CACHE_CHECK_CMD-@CACHE_CHECK_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_CACHE_DUMP_CMD=$${LVM_TEST_CACHE_DUMP_CMD-@CACHE_DUMP_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_CACHE_REPAIR_CMD=$${LVM_TEST_CACHE_REPAIR_CMD-@CACHE_REPAIR_CMD@}' >> $@ -t
$( Q) echo 'LVM_TEST_CACHE_RESTORE_CMD=$${LVM_TEST_CACHE_RESTORE_CMD-@CACHE_RESTORE_CMD@}' >> $@ -t
$( Q) echo 'export DM_UDEV_SYNCHRONISATION THIN RAID CACHE\' >> $@ -t
$( Q) echo ' LVM_TEST_THIN_CHECK_CMD LVM_TEST_THIN_DUMP_CMD LVM_TEST_THIN_REPAIR_CMD LVM_TEST_THIN_RESTORE_CMD\' >> $@ -t
$( Q) echo ' LVM_TEST_CACHE_CHECK_CMD LVM_TEST_CACHE_DUMP_CMD LVM_TEST_CACHE_REPAIR_CMD LVM_TEST_CACHE_RESTORE_CMD' >> $@ -t
$( Q) mv $@ -t $@
2011-01-05 03:16:18 +03:00
2014-06-27 03:00:37 +04:00
lib/paths-installed : lib /paths -common
2018-11-29 19:09:27 +03:00
@echo " [PATHS] $@ "
$( Q) $( RM) $@ -t
$( Q) cat lib/paths-common > $@ -t
$( Q) echo 'installed_testsuite=1' >> $@ -t
2019-05-30 19:02:55 +03:00
$( Q) echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:@datadir@/lvm2-testsuite/api:$$PATH' >> $@ -t
2018-11-29 19:09:27 +03:00
$( Q) mv $@ -t $@
2014-06-27 03:00:37 +04:00
lib/paths : lib /paths -common
2018-11-29 19:09:27 +03:00
@echo " [PATHS] $@ "
$( Q) $( RM) $@ -t
$( Q) cat lib/paths-common > $@ -t
$( Q) echo 'top_srcdir="$(top_srcdir)"' >> $@ -t
$( Q) echo 'abs_top_builddir="$(abs_top_builddir)"' >> $@ -t
$( Q) echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> $@ -t
$( Q) echo 'abs_srcdir="$(abs_srcdir)"' >> $@ -t
$( Q) echo 'abs_builddir="$(abs_builddir)"' >> $@ -t
$( Q) mv $@ -t $@
2011-01-05 03:16:18 +03:00
2015-09-08 15:11:06 +03:00
lib/version-expected : $( top_srcdir ) /VERSION .lib -dir -stamp
2018-11-29 19:09:27 +03:00
$( Q) cut -f 1 -d ' ' <$< >$@
2015-09-08 15:11:06 +03:00
2015-11-26 20:11:40 +03:00
lib/dm-version-expected : $( top_srcdir ) /VERSION_DM .lib -dir -stamp
2018-11-29 19:09:27 +03:00
$( Q) cut -f 1 -d ' ' <$< >$@
2015-11-26 20:11:40 +03:00
2015-09-08 15:33:29 +03:00
CMDS = lvm $( shell cat $( top_builddir) /tools/.commands 2>/dev/null)
2018-11-17 00:15:23 +03:00
LIB = $( addprefix lib/, $( LIB_SECURETEST) $( LIB_DMSECURETEST) $( LIB_SHARED) $( LIB_LOCAL) $( LIB_NOT) $( LIB_LINK_NOT) $( LIB_FLAVOURS) )
2011-09-25 01:10:19 +04:00
2018-12-01 02:44:22 +03:00
.tests-stamp : $( ALL ) $( LIB ) $( SUBDIRS ) lib /version -expected lib /dm -version -expected unit -test
2018-11-29 19:09:27 +03:00
@echo " [TEST-STAMP]"
2010-12-12 23:36:38 +03:00
@if test " $( srcdir) " != . ; then \
2011-11-23 16:21:41 +04:00
echo "Linking tests to builddir." ; \
$( MKDIR_P) shell; \
for f in $( subst $( srcdir) /,,$( ALL) ) ; do \
2018-11-29 19:09:27 +03:00
test -n " $( Q) " || echo " $( LN_S) -f $( abs_top_srcdir) /test/ $$ f $$ f " ; \
2015-05-11 22:47:39 +03:00
$( LN_S) -f $( abs_top_srcdir) /test/$$ f $$ f; \
2011-11-23 16:21:41 +04:00
done ; \
2010-12-12 23:36:38 +03:00
fi
2018-11-29 19:09:27 +03:00
$( Q) $( MKDIR_P) -m a = rwx $( LVM_TEST_RESULTS)
$( Q) touch $@
2009-09-04 16:54:23 +04:00
2011-11-23 16:21:41 +04:00
.lib-dir-stamp :
2018-11-29 19:09:27 +03:00
@echo " [LIB-STAMP]"
$( Q) $( MKDIR_P) lib unit
$( Q) $( RM) lib/clvmd
@for i in $( CMDS) ; do \
test -n " $( Q) " || echo " $( LN_S) -f lvm-wrapper lib/ $$ i " ; \
$( LN_S) -f lvm-wrapper lib/$$ i; done
@for i in daemons/dmeventd/dmeventd \
2018-07-10 22:40:48 +03:00
libdm/dm-tools/dmsetup \
2015-09-04 17:34:34 +03:00
daemons/lvmpolld/lvmpolld ; do \
2018-11-29 19:09:27 +03:00
test -n " $( Q) " || echo " $( LN_S) -f $( abs_top_builddir) / $$ i lib/ " ; \
2015-09-04 17:34:34 +03:00
$( LN_S) -f $( abs_top_builddir) /$$ i lib/; done
2018-11-29 19:09:27 +03:00
$( Q) $( LN_S) -f $( abs_top_builddir) /libdm/dm-tools/dmsetup lib/dmstats
$( Q) $( LN_S) -f $( abs_top_srcdir) /conf/lvmdbusd.profile lib/
$( Q) $( LN_S) -f $( abs_top_srcdir) /conf/thin-performance.profile lib/
$( Q) $( LN_S) -f $( abs_top_srcdir) /scripts/fsadm.sh lib/fsadm
@test " $( srcdir) " = . || \
2018-06-22 23:43:58 +03:00
for i in $( LIB_LVMLOCKD_CONF) $( LIB_MKE2FS_CONF) ; do \
2018-11-29 19:09:27 +03:00
test -n " $( Q) " || echo " $( LN_S) -f $( abs_top_srcdir) /test/lib/ $$ i lib/ " ; \
2018-06-22 23:43:58 +03:00
$( LN_S) -f $( abs_top_srcdir) /test/lib/$$ i lib/; done
2018-11-29 19:09:27 +03:00
$( Q) touch $@
2007-09-18 18:00:42 +04:00
2011-11-23 16:21:41 +04:00
Makefile : $( srcdir ) /Makefile .in $( top_builddir ) /config .status
cd $( top_builddir) && $( SHELL) ./config.status $( subdir) /$@
2007-09-18 18:00:42 +04:00
.NOTPARALLEL :