2015-05-11 21:47:39 +02:00
# Copyright (C) 2007-2015 Red Hat, Inc. All rights reserved.
2007-09-18 14:02:22 +00: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 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2007-09-18 14:02:22 +00:00
2007-09-18 14:00:42 +00:00
#TEST_OPTS=--verbose --debug
SHELL_PATH ?= $( SHELL)
RM ?= rm -f
2011-11-23 12:21:41 +00:00
subdir = $( shell pwd| sed 's,.*/,,' )
2007-09-18 14:00:42 +00:00
2007-09-18 14:02:22 +00:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
2014-03-14 14:10:29 +01:00
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
2015-02-05 16:30:50 +01:00
datarootdir = @datarootdir@
2011-11-23 12:21:41 +00:00
2013-06-03 12:07:31 +02:00
LVM_TEST_RESULTS ?= results
2014-11-17 00:41:33 +01:00
2018-06-08 12:37:57 +02:00
# FIXME: resolve testing of: unit
2022-09-01 10:06:14 +02:00
SOURCES := lib/not.c lib/harness.c lib/dmsecuretest.c
CXXSOURCES := lib/runner.cpp
2015-09-04 16:34:34 +02:00
CXXFLAGS += $( EXTRA_EXEC_CFLAGS)
2011-11-23 12:21:41 +00:00
2018-05-18 16:15:25 +02:00
CLEAN_DIRS += dbus/__pycache__ $( LVM_TEST_RESULTS)
i f n e q ( . , $( firstword $ ( srcdir ) ) )
2018-06-22 22:43:58 +02:00
CLEAN_TARGETS += $( RUN_BASE) $( addprefix lib/,$( LIB_LVMLOCKD_CONF) $( LIB_MKE2FS_CONF) )
2018-05-18 16:15:25 +02:00
e n d i f
2022-09-01 10:06:14 +02:00
CLEAN_TARGETS += $( shell find -H lib -type l) \
$( CXXSOURCES:%.cpp= %.o) $( CXXSOURCES:%.cpp= %.d) $( CXXSOURCES:%.cpp= %.gcno) $( CXXSOURCES:%.cpp= %.gcda)
2018-05-18 16:15:25 +02:00
CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $( LIB) $( addprefix lib/,\
2022-09-01 10:06:14 +02:00
clvmd harness dmeventd dmsetup dmstats lvmpolld \
$( LVM_PROFILES) $( LVM_SCRIPTS) \
2018-05-18 16:15:25 +02:00
paths-installed paths-installed-t paths-common paths-common-t)
2011-01-13 14:58:59 +00:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2007-09-18 14:00:42 +00:00
2010-04-13 06:45:53 +00:00
T ?= .
2010-10-12 16:17:25 +00:00
S ?= @ # never match anything by default
2010-10-14 14:36:26 +00:00
VERBOSE ?= 0
2013-10-09 14:02:34 +02:00
comma = ,
2019-05-30 18:02:55 +02: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-24 21:10:19 +00:00
RUN_BASE = $( subst $( srcdir) /,,$( RUN) )
2010-04-13 06:45:53 +00:00
2023-07-11 15:48:15 +02:00
i f e q ( "@BUILD_DMEVENTD@" , "yes" )
DMEVENTD_TOOLS := \
daemons/dmeventd/dmeventd
e n d i f
2015-05-09 00:59:18 +01:00
i f e q ( "@BUILD_LVMPOLLD@" , "yes" )
LVMPOLLD_RUN_BASE = $( RUN_BASE)
2018-07-10 14:40:48 -05:00
LVMPOLLD_NDEV_FLAVOUR = ,ndev-lvmpolld
LVMPOLLD_UDEV_FLAVOUR = ,udev-lvmpolld
2023-07-11 15:48:15 +02:00
LVMPOLLD_TOOLS := \
daemons/lvmpolld/lvmpolld
2015-05-09 00:59:18 +01:00
e n d i f
2013-12-05 12:31:49 +01:00
2016-02-23 16:34:46 -06:00
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
LVMLOCKD_RUN_BASE = $( RUN_BASE)
LVMLOCKD_UDEV_FLAVOUR = ,udev-lvmlockd-test
2023-07-11 15:48:15 +02:00
LVMLOCKD_TOOLS := \
daemons/lvmlockd/lvmlockd\
daemons/lvmlockd/lvmlockctl
2016-02-23 16:34:46 -06:00
e n d i f
2009-11-30 14:59:26 +00:00
# Shell quote;
2015-05-18 10:27:15 +02:00
SHELL_PATH_SQ := $( subst ',' \' ' ,$( SHELL_PATH) )
2009-11-30 14:59:26 +00:00
2010-01-11 15:48:49 +00:00
i f e q ( "@UDEV_SYNC@" , "yes" )
2023-07-02 16:41:34 +02:00
dm_udev_synchronization = 1
2010-01-11 15:48:49 +00:00
e n d i f
2014-06-27 01:00:37 +02:00
all : .tests -stamp
2011-09-24 21:10:19 +00:00
2012-03-28 11:10:08 +00:00
help :
@echo -e "\nAvailable targets:"
@echo " all Default target, run check."
@echo " check Run all tests."
2015-07-30 20:23:14 +02:00
@echo " check_system Run all tests using udev."
2018-07-10 14:40:48 -05:00
@echo " check_local Run tests."
2015-05-09 00:59:18 +01:00
@echo " check_lvmpolld Run tests with lvmpolld daemon."
2021-03-08 17:19:26 -06:00
@echo " check_devicesfile Run tests using a devices file."
2016-10-17 11:13:43 +02:00
@echo " check_all_lvmpolld Run all tests with lvmpolld daemon."
2015-03-05 14:00:44 -06:00
@echo " check_lvmlockd_sanlock Run tests with lvmlockd and sanlock."
@echo " check_lvmlockd_dlm Run tests with lvmlockd and dlm."
2021-06-03 17:59:09 +08:00
@echo " check_lvmlockd_idm Run tests with lvmlockd and idm."
2016-01-14 16:12:46 -06:00
@echo " check_lvmlockd_test Run tests with lvmlockd --test."
2018-05-12 18:14:53 +02:00
@echo " run-unit-test Run only unit tests (root not needed)."
2012-03-28 11:10:08 +00:00
@echo " clean Clean dir."
@echo " help Display callable targets."
@echo -e "\nSupported variables:"
2016-04-20 23:18:51 +02:00
@echo " LVM_TEST_AUX_TRACE Set for verbose messages for aux scripts []."
2015-04-28 11:35:56 +02:00
@echo " LVM_TEST_BACKING_DEVICE Set device used for testing (see also LVM_TEST_DIR)."
2021-06-03 17:59:22 +08:00
@echo " LVM_TEST_MULTI_HOST Set multiple hosts used for testing."
2014-03-14 14:10:29 +01:00
@echo " LVM_TEST_CAN_CLOBBER_DMESG Allow to clobber dmesg buffer without /dev/kmsg. (1)"
2012-03-28 11:10:08 +00:00
@echo " LVM_TEST_DEVDIR Set to '/dev' to run on real /dev."
2018-05-07 11:35:35 +02:00
@echo " LVM_TEST_PREFER_BRD Prefer using brd (ramdisk) over loop for testing [1]."
2014-05-26 23:28:03 +02:00
@echo " LVM_TEST_DIR Where to create test files [ $( LVM_TEST_DIR) ]. "
2012-03-28 11:10:08 +00:00
@echo " LVM_TEST_LOCKING Normal (1), Cluster (3)."
2015-05-09 00:59:18 +01:00
@echo " LVM_TEST_LVMPOLLD Start lvmpolld"
2012-03-28 11:10:08 +00:00
@echo " LVM_TEST_NODEBUG Do not debug lvm commands."
2023-09-16 01:03:37 +02:00
@echo " LVM_TEST_PARALLEL May skip agressive wipe of LVMTEST resources."
2013-06-03 12:07:31 +02:00
@echo " LVM_TEST_RESULTS Where to create result files [results]."
2014-05-26 23:28:03 +02: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 00:41:33 +01: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-08 22:23:39 +02:00
@echo " LVM_TEST_UNLIMITED Set to get unlimited test log (>32MB)"
2023-02-16 16:50:07 +01:00
@echo " LVM_TEST_DEVICE_LIST File path listing real devs that tests can use."
2015-04-14 09:45:36 +02:00
@echo " LVM_VALGRIND Enable valgrind testing, execs $$ " VALGRIND.
2014-03-14 14:10:29 +01:00
@echo " LVM_VALGRIND_DMEVENTD Enable valgrind testing of dmeventd (1)."
2020-09-24 15:14:44 +02:00
@echo " LVM_VALGRIND_LVMPOLLD Enable valgrind testing of lvmpolld (1)."
2015-04-14 09:45:36 +02:00
@echo " LVM_STRACE Enable strace logging."
2023-09-16 01:03:37 +02:00
@echo " LVM_DEBUG_LEVEL Sets debugging level for valgrind/strace (use > 0)."
2023-02-16 16:50:07 +01:00
@echo " LVM_DEBUG_LVMDBUS Run lvmdbus with --debug option."
2012-03-28 11:10:08 +00:00
@echo " LVM_VERIFY_UDEV Default verify state for lvm.conf."
2017-10-26 13:57:51 +02: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 11:10:08 +00:00
@echo " VERBOSE Verbose output (1), timing (2)."
2013-05-27 03:12:03 +02:00
check : .tests -stamp
2014-06-27 01:00:37 +02:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 21:11:09 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-26 14:56:08 +02:00
--flavours ndev-vanilla$( LVMPOLLD_NDEV_FLAVOUR) --only $( T) --skip $( S)
2008-09-29 16:07:02 +00:00
2013-12-15 17:26:28 +01:00
check_system : .tests -stamp
2014-06-27 01:00:37 +02:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 21:11:09 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-26 14:56:08 +02:00
--flavours udev-vanilla$( LVMPOLLD_UDEV_FLAVOUR) $( LVMLOCKD_UDEV_FLAVOUR) --only $( T) --skip $( S)
2010-04-13 13:28:52 +00:00
2011-01-05 00:16:18 +00:00
check_local : .tests -stamp
2014-06-27 01:00:37 +02:00
VERBOSE = $( VERBOSE) ./lib/runner \
2015-03-11 21:11:09 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2014-09-14 11:11:12 +02:00
--flavours ndev-vanilla --only $( T) --skip $( S)
2010-04-13 13:28:52 +00:00
2015-05-09 00:59:18 +01:00
i f e q ( "@BUILD_LVMPOLLD@" , "yes" )
check_lvmpolld : .tests -stamp
2016-10-17 11:13:43 +02:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 10:01:21 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-10-17 11:13:43 +02:00
--flavours ndev-lvmpolld --only $( T) --skip $( S)
check_all_lvmpolld : .tests -stamp
2015-05-09 00:59:18 +01:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 10:01:21 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2018-07-10 14:40:48 -05:00
--flavours ndev-lvmpolld --only $( T) --skip $( S)
2015-05-09 00:59:18 +01:00
e n d i f
2021-03-08 17:19:26 -06:00
check_devicesfile : .tests -stamp
VERBOSE = $( VERBOSE) ./lib/runner \
--testdir . --outdir $( LVM_TEST_RESULTS) \
--flavours ndev-devicesfile --only $( T) --skip $( S)
2015-03-05 14:00:44 -06:00
i f e q ( "@BUILD_LVMLOCKD@" , "yes" )
check_lvmlockd_sanlock : .tests -stamp
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 10:01:21 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-01-14 16:12:46 -06:00
--flavours udev-lvmlockd-sanlock --only shell/aa-lvmlockd-sanlock-prepare.sh,$( T) ,shell/zz-lvmlockd-sanlock-remove.sh --skip $( S)
2015-03-05 14:00:44 -06:00
check_lvmlockd_dlm : .tests -stamp
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 10:01:21 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-01-14 16:12:46 -06:00
--flavours udev-lvmlockd-dlm --only shell/aa-lvmlockd-dlm-prepare.sh,$( T) ,shell/zz-lvmlockd-dlm-remove.sh --skip $( S)
2021-06-16 21:44:27 +08:00
check_lvmlockd_idm : .tests -stamp lib /idm_inject_failure
2021-06-03 17:59:16 +08:00
$( INSTALL_PROGRAM) lib/idm_inject_failure $( EXECDIR)
2021-06-03 17:59:09 +08:00
VERBOSE = $( VERBOSE) ./lib/runner \
--testdir . --outdir $( LVM_TEST_RESULTS) \
--flavours udev-lvmlockd-idm --only shell/aa-lvmlockd-idm-prepare.sh,$( T) ,shell/zz-lvmlockd-idm-remove.sh --skip $( S)
2016-01-14 16:12:46 -06:00
check_lvmlockd_test : .tests -stamp
2015-03-05 14:00:44 -06:00
VERBOSE = $( VERBOSE) ./lib/runner \
2018-11-08 10:01:21 +01:00
--testdir . --outdir $( LVM_TEST_RESULTS) \
2016-02-23 13:58:22 -06:00
--flavours udev-lvmlockd-test --only $( T) --skip $( S)
2015-03-05 14:00:44 -06:00
e n d i f
2022-09-01 10:06:14 +02:00
run-unit-test unit-test unit/unit-test :
@echo " [MAKE] $( @F) "
$( Q) $( MAKE) -C $( top_builddir) $( @F)
2018-05-12 18:14:53 +02:00
2022-09-01 10:06:14 +02:00
DATADIR := $( datadir) /lvm2-testsuite
EXECDIR := $( libexecdir) /lvm2-testsuite
2014-06-27 01:00:37 +02:00
2022-09-01 10:06:14 +02:00
LIB_FLAVOURS := \
2015-09-04 16:34:34 +02:00
flavour-ndev-lvmpolld\
flavour-ndev-vanilla\
2021-03-08 17:19:26 -06:00
flavour-ndev-devicesfile\
2015-09-04 16:34:34 +02:00
flavour-udev-lvmpolld\
flavour-udev-lvmlockd-sanlock\
flavour-udev-lvmlockd-dlm\
2021-06-03 17:59:09 +08:00
flavour-udev-lvmlockd-idm\
2016-01-14 16:12:46 -06:00
flavour-udev-lvmlockd-test\
2015-09-04 16:34:34 +02:00
flavour-udev-vanilla
2022-09-01 10:06:14 +02:00
LIB_LVMLOCKD_CONF := \
2015-09-04 16:34:34 +02:00
test-corosync-conf \
test-dlm-conf \
test-sanlock-conf
2022-09-01 10:06:14 +02:00
LIB_MKE2FS_CONF := mke2fs.conf
2023-07-11 15:48:15 +02:00
LVM_TOOLS := \
$( LVMPOLLD_TOOLS) \
$( LVMLOCKD_TOOLS) \
$( DMEVENTD_TOOLS) \
2022-09-01 10:06:14 +02:00
libdm/dm-tools/dmsetup
LVM_PROFILES := $( addsuffix .profile,\
cache-mq\
cache-smq\
lvmdbusd\
thin-performance)
2018-06-22 22:43:58 +02:00
2022-09-01 10:06:14 +02:00
LIB_LINK_NOT := invalid fail should
LIB_LOCAL := paths runner
LIB_NOT := not
LIB_SHARED := check aux inittest utils get lvm-wrapper lvm_vdo_wrapper
LIB_CONF := $( LIB_LVMLOCKD_CONF) $( LIB_MKE2FS_CONF)
LIB_DATA := $( LIB_FLAVOURS) dm-version-expected version-expected
LIB_EXEC := $( LIB_NOT) dmsecuretest securetest
LVM_SCRIPTS := fsadm lvm_import_vdo
2014-06-27 01:00:37 +02:00
2015-12-11 13:17:08 +00:00
install : .tests -stamp lib /paths -installed
2022-09-01 10:06:14 +02:00
$( SHOW) " [INSTALL] tests"
2019-05-30 18:02:55 +02:00
$( Q) $( INSTALL_DIR) $( DATADIR) /{ shell,api,unit,lib,dbus} $( EXECDIR)
2018-11-29 17:09:27 +01:00
$( Q) $( INSTALL_DATA) shell/*.sh $( DATADIR) /shell
2022-09-01 10:06:14 +02:00
$( Q) $( INSTALL_DATA) api/*.sh $( DATADIR) /api
2018-11-29 17:09:27 +01:00
$( Q) $( INSTALL_DATA) unit/*.sh $( DATADIR) /unit
2022-09-01 10:06:14 +02:00
$( Q) - $( INSTALL_PROGRAM) unit/unit-test $( DATADIR) /unit
$( Q) - $( INSTALL_PROGRAM) dbus/*.py $( DATADIR) /dbus/
$( Q) $( INSTALL_DATA) lib/paths-installed $( DATADIR) /lib/paths
$( Q) cd lib && \
2023-04-22 11:21:46 +02:00
$( INSTALL_DATA) $( LIB_DATA) $( LIB_CONF) $( DATADIR) /lib
2022-09-01 10:06:14 +02:00
$( Q) cd lib && \
$( INSTALL_SCRIPT) $( LIB_SHARED) $( DATADIR) /lib
$( Q) cd lib && \
$( INSTALL_PROGRAM) -D $( LIB_EXEC) $( EXECDIR)
$( Q) cd $( abs_top_srcdir) /conf && \
$( INSTALL_DATA) $( LVM_PROFILES) $( DATADIR) /lib
$( Q) cd $( DATADIR) /lib && \
$( foreach FILE, $( CMDS) , $( LN_S) -f lvm-wrapper $( FILE) $( newline) )
$( Q) cd $( EXECDIR) && \
$( foreach FILE, $( LIB_LINK_NOT) , $( LN_S) -f $( LIB_NOT) $( FILE) $( newline) )
2018-11-29 17:09:27 +01:00
$( Q) $( INSTALL_PROGRAM) -D lib/runner $( bindir) /lvm2-testsuite
2014-06-27 01:00:37 +02:00
2022-09-01 10:06:14 +02:00
lib/should lib/invalid lib/fail : lib /not
$( SHOW) " [LN] $@ "
$( Q) $( LN_S) -f $( <F) $@
2014-03-28 00:34:04 +01:00
2014-06-08 18:24:33 +02:00
lib/runner : lib /runner .o .lib -dir -stamp
2022-09-01 10:06:14 +02:00
$( SHOW) " [LD] $@ "
2023-10-03 01:47:17 +02:00
$( Q) $( CXX) $( CXXFLAGS) $( LDFLAGS) $( RT_LIBS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -o $@ $<
2018-11-16 22:15:23 +01:00
lib/securetest : lib /dmsecuretest .o .lib -dir -stamp
2022-09-01 10:06:14 +02:00
$( SHOW) " [LD] $@ "
$( Q) $( CC) $( CFLAGS) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -o $@ $< -L$( interfacebuilddir) -ldevmapper $( LIBS)
2021-06-03 17:59:16 +08:00
2022-09-01 10:06:14 +02:00
lib/not : lib /not .o
2014-06-25 21:34:34 +02:00
lib/runner.o : $( wildcard $ ( srcdir ) /lib /*.h )
2022-09-01 10:06:14 +02:00
C F L A G S _ l i b / runner.o += $( EXTRA_EXEC_CFLAGS)
C F L A G S _ l i b / dmsecuretest.o += $( EXTRA_EXEC_CFLAGS)
L D F L A G S _ l i b / dmsecuretest += $( EXTRA_EXEC_LDFLAGS) $( INTERNAL_LIBS) $( LIBS)
L D F L A G S _ l i b / idm_inject_failure += $( INTERNAL_LIBS) $( LIBS) -lseagate_ilm
2015-09-04 16:34:34 +02:00
2011-11-23 14:56:47 +00:00
lib/% : lib /%.o .lib -dir -stamp
2022-09-01 10:06:14 +02:00
$( SHOW) " [LD] $@ "
$( Q) $( CC) $( CFLAGS) $( LDFLAGS) $( ELDFLAGS) -o $@ $< $( LDFLAGS_$@ )
2009-02-12 19:54:45 +00:00
2011-01-05 00:16:18 +00:00
lib/% : $( srcdir ) /lib /%.sh .lib -dir -stamp
2022-09-01 10:06:14 +02:00
$( SHOW) " [CP] $@ "
$( Q) cp $< $@
$( Q) $( CHMOD) +x $@
lib/% : $( top_srcdir ) /scripts /%.sh .lib -dir -stamp
$( SHOW) " [CP] $@ "
2018-11-29 17:09:27 +01:00
$( Q) cp $< $@
$( Q) $( CHMOD) +x $@
2010-04-12 19:02:59 +00:00
2014-06-27 09:10:56 +02:00
lib/flavour-% : $( srcdir ) /lib /flavour -%.sh .lib -dir -stamp
2022-09-01 10:06:14 +02:00
$( SHOW) " [FLAVOUR] $< "
2018-11-29 17:09:27 +01:00
$( Q) cp $< $@
2014-06-27 01:00:37 +02:00
2022-09-01 10:06:14 +02:00
lib/paths-common : $( srcdir ) /Makefile .in Makefile .lib -dir -stamp
$( SHOW) " [PATHS] $@ "
2023-07-02 16:41:34 +02:00
$( Q) echo 'DM_UDEV_SYNCHRONIZATION=$(dm_udev_synchronization)' >> $@ -t
2018-11-29 17:09:27 +01:00
$( 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
2023-07-02 16:41:34 +02:00
$( Q) echo 'export DM_UDEV_SYNCHRONIZATION THIN RAID CACHE\' >> $@ -t
2018-11-29 17:09:27 +01:00
$( 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 00:16:18 +00:00
2014-06-27 01:00:37 +02:00
lib/paths-installed : lib /paths -common
2022-09-01 10:06:14 +02:00
$( SHOW) " [PATHS] $@ "
2018-11-29 17:09:27 +01:00
$( Q) $( RM) $@ -t
$( Q) cat lib/paths-common > $@ -t
$( Q) echo 'installed_testsuite=1' >> $@ -t
2019-05-30 18:02:55 +02:00
$( Q) echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:@datadir@/lvm2-testsuite/api:$$PATH' >> $@ -t
2018-11-29 17:09:27 +01:00
$( Q) mv $@ -t $@
2014-06-27 01:00:37 +02:00
lib/paths : lib /paths -common
2022-09-01 10:06:14 +02:00
$( SHOW) " [PATHS] $@ "
2018-11-29 17:09:27 +01:00
$( 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 00:16:18 +00:00
2015-09-08 14:11:06 +02:00
lib/version-expected : $( top_srcdir ) /VERSION .lib -dir -stamp
2018-11-29 17:09:27 +01:00
$( Q) cut -f 1 -d ' ' <$< >$@
2015-09-08 14:11:06 +02:00
2015-11-26 17:11:40 +00:00
lib/dm-version-expected : $( top_srcdir ) /VERSION_DM .lib -dir -stamp
2018-11-29 17:09:27 +01:00
$( Q) cut -f 1 -d ' ' <$< >$@
2015-11-26 17:11:40 +00:00
2022-09-01 10:06:14 +02:00
CMDS := lvm $( shell cat $( abs_top_builddir) /tools/.commands 2>/dev/null)
LIB := $( addprefix lib/, $( LVM_SCRIPTS) $( LIB_SHARED) $( LIB_LOCAL) $( LIB_EXEC) $( LIB_LINK_NOT) $( LIB_DATA) )
.tests-stamp : .lib -dir -stamp $( LIB ) $( SUBDIRS )
$( SHOW) " [TESTS-STAMP]"
i f n e q ( . , $( firstword $ ( srcdir ) ) )
$( SHOW) " Linking tests to builddir."
$( Q) $( LN_S) -f $( srcdir) /shell
e n d i f
2018-11-29 17:09:27 +01:00
$( Q) $( MKDIR_P) -m a = rwx $( LVM_TEST_RESULTS)
$( Q) touch $@
2009-09-04 12:54:23 +00:00
2022-09-01 10:06:14 +02:00
.lib-dir-stamp : unit /unit -test
$( SHOW) " [LIB-DIR-STAMP]"
$( Q) $( MKDIR_P) api lib unit
2018-11-29 17:09:27 +01:00
$( Q) $( RM) lib/clvmd
2022-09-01 10:06:14 +02:00
$( Q) $( LN_S) -f dmsetup lib/dmstats
$( Q) $( foreach FILE, $( CMDS) , $( LN_S) -f lvm-wrapper lib/$( FILE) $( newline) )
$( Q) $( foreach FILE, $( LVM_TOOLS) , $( LN_S) -f $( abs_top_builddir) /$( FILE) lib/ $( newline) )
$( Q) $( LN_S) -f $( addprefix $( abs_top_srcdir) /conf/, $( LVM_PROFILES) ) lib/
i f n e q ( . , $( firstword $ ( srcdir ) ) )
$( Q) $( LN_S) -f $( addprefix $( abs_top_srcdir) /test/lib/,\
$( LIB_LVMLOCKD_CONF) $( LIB_MKE2FS_CONF) ) lib/
e n d i f
2018-11-29 17:09:27 +01:00
$( Q) touch $@
2007-09-18 14:00:42 +00:00
2011-11-23 12:21:41 +00:00
Makefile : $( srcdir ) /Makefile .in $( top_builddir ) /config .status
cd $( top_builddir) && $( SHELL) ./config.status $( subdir) /$@
2007-09-18 14:00:42 +00:00
.NOTPARALLEL :