From c87e1afa0327c60621075f581bffb30b33735442 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 10 Jul 2017 13:33:55 +0200 Subject: [PATCH] tests: export many shell vars with 1 command --- test/Makefile.in | 36 ++++++++++++++++++++---------------- test/lib/inittest.sh | 7 ++++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index c39959609..eee9bf2f3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -273,22 +273,26 @@ lib/flavour-%: $(srcdir)/lib/flavour-%.sh .lib-dir-stamp cp $< $@ lib/paths-common: $(srcdir)/Makefile.in .lib-dir-stamp Makefile - echo 'export DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t - echo 'export THIN=@THIN@' >> $@-t - echo 'export RAID=@RAID@' >> $@-t - echo 'export CACHE=@CACHE@' >> $@-t - echo 'export LVMETAD_PIDFILE="@LVMETAD_PIDFILE@"' >> $@-t - echo 'export LVMPOLLD_PIDFILE="@LVMPOLLD_PIDFILE@"' >> $@-t - echo 'export DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@-t - echo 'export CLVMD_PIDFILE="@CLVMD_PIDFILE@"' >> $@-t - echo 'export LVM_TEST_THIN_CHECK_CMD=$${LVM_TEST_THIN_CHECK_CMD-@THIN_CHECK_CMD@}' >> $@-t - echo 'export LVM_TEST_THIN_DUMP_CMD=$${LVM_TEST_THIN_DUMP_CMD-@THIN_DUMP_CMD@}' >> $@-t - echo 'export LVM_TEST_THIN_REPAIR_CMD=$${LVM_TEST_THIN_REPAIR_CMD-@THIN_REPAIR_CMD@}' >> $@-t - echo 'export LVM_TEST_THIN_RESTORE_CMD=$${LVM_TEST_THIN_RESTORE_CMD-@THIN_RESTORE_CMD@}' >> $@-t - echo 'export LVM_TEST_CACHE_CHECK_CMD=$${LVM_TEST_CACHE_CHECK_CMD-@CACHE_CHECK_CMD@}' >> $@-t - echo 'export LVM_TEST_CACHE_DUMP_CMD=$${LVM_TEST_CACHE_DUMP_CMD-@CACHE_DUMP_CMD@}' >> $@-t - echo 'export LVM_TEST_CACHE_REPAIR_CMD=$${LVM_TEST_CACHE_REPAIR_CMD-@CACHE_REPAIR_CMD@}' >> $@-t - echo 'export LVM_TEST_CACHE_RESTORE_CMD=$${LVM_TEST_CACHE_RESTORE_CMD-@CACHE_RESTORE_CMD@}' >> $@-t + echo 'DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t + echo 'THIN=@THIN@' >> $@-t + echo 'RAID=@RAID@' >> $@-t + echo 'CACHE=@CACHE@' >> $@-t + echo 'LVMETAD_PIDFILE="@LVMETAD_PIDFILE@"' >> $@-t + echo 'LVMPOLLD_PIDFILE="@LVMPOLLD_PIDFILE@"' >> $@-t + echo 'DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@-t + echo 'CLVMD_PIDFILE="@CLVMD_PIDFILE@"' >> $@-t + echo 'LVM_TEST_THIN_CHECK_CMD=$${LVM_TEST_THIN_CHECK_CMD-@THIN_CHECK_CMD@}' >> $@-t + echo 'LVM_TEST_THIN_DUMP_CMD=$${LVM_TEST_THIN_DUMP_CMD-@THIN_DUMP_CMD@}' >> $@-t + echo 'LVM_TEST_THIN_REPAIR_CMD=$${LVM_TEST_THIN_REPAIR_CMD-@THIN_REPAIR_CMD@}' >> $@-t + echo 'LVM_TEST_THIN_RESTORE_CMD=$${LVM_TEST_THIN_RESTORE_CMD-@THIN_RESTORE_CMD@}' >> $@-t + echo 'LVM_TEST_CACHE_CHECK_CMD=$${LVM_TEST_CACHE_CHECK_CMD-@CACHE_CHECK_CMD@}' >> $@-t + echo 'LVM_TEST_CACHE_DUMP_CMD=$${LVM_TEST_CACHE_DUMP_CMD-@CACHE_DUMP_CMD@}' >> $@-t + echo 'LVM_TEST_CACHE_REPAIR_CMD=$${LVM_TEST_CACHE_REPAIR_CMD-@CACHE_REPAIR_CMD@}' >> $@-t + echo 'LVM_TEST_CACHE_RESTORE_CMD=$${LVM_TEST_CACHE_RESTORE_CMD-@CACHE_RESTORE_CMD@}' >> $@-t + echo 'export DM_UDEV_SYNCHRONISATION THIN RAID CACHE\' >> $@-t + echo ' LVMETAD_PIDFILE LVMPOLLD_PIDFILE DMEVENTD_PIDFILE CLVMD_PIDFILE\' >> $@-t + echo ' LVM_TEST_THIN_CHECK_CMD LVM_TEST_THIN_DUMP_CMD LVM_TEST_THIN_REPAIR_CMD LVM_TEST_THIN_RESTORE_CMD\' >> $@-t + echo ' LVM_TEST_CACHE_CHECK_CMD LVM_TEST_CACHE_DUMP_CMD LVM_TEST_CACHE_REPAIR_CMD LVM_TEST_CACHE_RESTORE_CMD' >> $@-t mv $@-t $@ lib/paths-installed: lib/paths-common diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh index f959b7174..d3844b467 100644 --- a/test/lib/inittest.sh +++ b/test/lib/inittest.sh @@ -57,9 +57,10 @@ TESTDIR=$(mkdtemp "${LVM_TEST_DIR:-/tmp}" "$PREFIX.XXXXXXXXXX") || \ RUNNING_DMEVENTD=$(pgrep dmeventd || true) export TESTOLDPWD TESTDIR COMMON_PREFIX PREFIX RUNNING_DMEVENTD -export LVM_LOG_FILE_EPOCH=DEBUG -export LVM_LOG_FILE_MAX_LINES=100000 -export LVM_EXPECTED_EXIT_STATUS=1 +LVM_LOG_FILE_EPOCH=DEBUG +LVM_LOG_FILE_MAX_LINES=100000 +LVM_EXPECTED_EXIT_STATUS=1 +export LVM_LOG_FILE_EPOCH LVM_LOG_FILE_MAX_LINES LVM_EXPECTED_EXIT_STATUS test -n "$BASH" && trap 'set +vx; STACKTRACE; set -vx' ERR trap 'aux teardown' EXIT # don't forget to clean up -- 2.43.5