diff --git a/WHATS_NEW b/WHATS_NEW index 6003f0a1b..a065a1739 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 3.0.0 ============= + Allow raid4 -> linear conversion request. + Fix lvconvert striped/raid0/raid0_meta -> raid6 regression. Add 'lvm2-activation-generator:' prefix for kmsg messages logged by generator. Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. Reduce max concurrent aios to avoid EMFILE with many devices. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 2bc179ae9..1af3729e3 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -6127,10 +6127,10 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr /* striped/raid0 -> */ } else if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) { if (segtype_is_any_raid6(*segtype)) - seg_flag = SEG_RAID6_N_6; + seg_flag = seg_from->area_count < 3 ? SEG_RAID5_N : SEG_RAID6_N_6; - if (segtype_is_linear(*segtype) || - (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) + else if (segtype_is_linear(*segtype) || + (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) seg_flag = SEG_RAID5_N; /* raid1 -> */ @@ -6149,9 +6149,17 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr else if (!segtype_is_raid4(*segtype) && !segtype_is_any_raid5(*segtype)) seg_flag = SEG_RAID5_LS; - /* raid5* -> */ - } else if (seg_is_any_raid5(seg_from)) { - if (segtype_is_raid1(*segtype) || segtype_is_linear(*segtype)) { + /* raid4/raid5* -> */ + } else if (seg_is_raid4(seg_from) || seg_is_any_raid5(seg_from)) { + if (seg_is_raid4(seg_from) && segtype_is_any_raid5(*segtype)) { + if (!segtype_is_raid5_n(*segtype)) + seg_flag = SEG_RAID5_N; + + } else if (seg_is_any_raid5(seg_from) && segtype_is_raid4(*segtype)) { + if (!seg_is_raid5_n(seg_from)) + seg_flag = SEG_RAID5_N; + + } else if (segtype_is_raid1(*segtype) || segtype_is_linear(*segtype)) { if (seg_from->area_count != 2) { log_error("Converting %s LV %s to 2 stripes first.", lvseg_name(seg_from), display_lvname(seg_from->lv)); @@ -6173,12 +6181,12 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count); } else - seg_flag = _raid_seg_flag_5_to_6(seg_from); + seg_flag = seg_is_raid4(seg_from) ? SEG_RAID6_N_6 :_raid_seg_flag_5_to_6(seg_from); } else if (segtype_is_striped(*segtype) || segtype_is_raid10(*segtype)) { int change = 0; - if (!seg_is_raid5_n(seg_from)) { + if (!seg_is_raid4(seg_from) && !seg_is_raid5_n(seg_from)) { seg_flag = SEG_RAID5_N; } else if (*stripes > 2 && *stripes != seg_from->area_count - seg_from->segtype->parity_devs) { @@ -6199,10 +6207,6 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count); } - /* raid4 -> * */ - } else if (seg_is_raid4(seg_from) && !segtype_is_raid4(*segtype) && !segtype_is_striped(*segtype)) { - seg_flag = segtype_is_any_raid6(*segtype) ? SEG_RAID6_N_6 : SEG_RAID5_N; - /* raid6 -> striped/raid0/raid5/raid10 */ } else if (seg_is_any_raid6(seg_from)) { if (segtype_is_raid1(*segtype)) { diff --git a/test/Makefile.in b/test/Makefile.in index a9bb08306..bb736a686 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -96,7 +96,6 @@ help: @echo " LVM_TEST_PREFER_BRD Prefer using brd (ramdisk) over loop for testing [1]." @echo " LVM_TEST_DIR Where to create test files [$(LVM_TEST_DIR)]." @echo " LVM_TEST_LOCKING Normal (1), Cluster (3)." - @echo " LVM_TEST_LVMETAD_DEBUG_OPTS Allows to override debug opts [-l all]." @echo " LVM_TEST_LVMPOLLD Start lvmpolld" @echo " LVM_TEST_NODEBUG Do not debug lvm commands." @echo " LVM_TEST_PARALLEL May skip agresive wipe of LVMTEST resources." @@ -252,7 +251,6 @@ lib/flavour-%: $(srcdir)/lib/flavour-%.sh .lib-dir-stamp lib/paths-common: $(srcdir)/Makefile.in .lib-dir-stamp Makefile echo 'DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t - echo 'LVMETAD_PIDFILE="@LVMETAD_PIDFILE@"' >> $@-t echo 'LVMPOLLD_PIDFILE="@LVMPOLLD_PIDFILE@"' >> $@-t echo 'DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@-t echo 'LVM_TEST_THIN_CHECK_CMD=$${LVM_TEST_THIN_CHECK_CMD-@THIN_CHECK_CMD@}' >> $@-t @@ -264,7 +262,6 @@ lib/paths-common: $(srcdir)/Makefile.in .lib-dir-stamp Makefile 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 \' >> $@-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 $@ diff --git a/test/lib/aux.sh b/test/lib/aux.sh index f72c851d8..c3aeb436f 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -214,62 +214,7 @@ prepare_dmeventd() { echo ok } -prepare_lvmetad() { - check_daemon_in_builddir lvmetad - - local run_valgrind="" - test "${LVM_VALGRIND_LVMETAD:-0}" -eq 0 || run_valgrind="run_valgrind" - - kill_sleep_kill_ LOCAL_LVMETAD "${LVM_VALGRIND_LVMETAD:-0}" - - lvmconf "global/use_lvmetad = 1" "devices/md_component_detection = 0" - # Default debug is "-l all" and could be override - # by setting LVM_TEST_LVMETAD_DEBUG_OPTS before calling inittest. - echo -n "## preparing lvmetad..." - # shellcheck disable=SC2086 - $run_valgrind lvmetad -f "$@" -s "$TESTDIR/lvmetad.socket" \ - ${LVM_TEST_LVMETAD_DEBUG_OPTS--l all} & - echo $! > LOCAL_LVMETAD - for i in {200..0} ; do - test "$i" -eq 0 && die "Startup of lvmetad is too slow." - test -e "$TESTDIR/lvmetad.socket" && break - echo -n . - sleep .1; - done - echo ok -} - -lvmetad_talk() { - local use=nc - if type -p socat >& /dev/null; then - use=socat - elif echo | not nc -U "$TESTDIR/lvmetad.socket" ; then - echo "WARNING: Neither socat nor nc -U seems to be available." 1>&2 - echo "## failed to contact lvmetad." - return 1 - fi - - if test "$use" = nc ; then - nc -U "$TESTDIR/lvmetad.socket" - else - socat "unix-connect:$TESTDIR/lvmetad.socket" - - fi | tee -a lvmetad-talk.txt -} - -lvmetad_dump() { - (echo 'request="dump"'; echo '##') | lvmetad_talk "$@" -} - -notify_lvmetad() { - if test -e LOCAL_LVMETAD; then - # Ignore results here... - LVM_LOG_FILE_EPOCH="" pvscan --cache "$@" || true - rm -f debug.log - fi -} - prepare_lvmpolld() { - check_daemon_in_builddir lvmetad lvmconf "global/use_lvmpolld = 1" local run_valgrind="" @@ -583,8 +528,6 @@ teardown() { killall -9 lvmlockd || true fi - kill_sleep_kill_ LOCAL_LVMETAD "${LVM_VALGRIND_LVMETAD:-0}" - dm_table | not grep -E -q "$vg|$vg1|$vg2|$vg3|$vg4" || { # Avoid activation of dmeventd if there is no pid cfg=$(test -s LOCAL_DMEVENTD || echo "--config activation{monitoring=0}") @@ -802,11 +745,7 @@ prepare_md_dev() { echo "${mddevdir}${mdname}" > MD_DEV_PV ;; esac echo "$mddev" > MD_DEV - notify_lvmetad "$(< MD_DEV_PV)" printf "%s\n" "${@:4}" > MD_DEVICES - for mddev in "${@:4}"; do - notify_lvmetad "$mddev" - done } cleanup_md_dev() { @@ -820,12 +759,10 @@ cleanup_md_dev() { mddev_pv=$(< MD_DEV_PV) udev_wait mdadm --stop "$mddev" || true - notify_lvmetad "$mddev_pv" udev_wait # wait till events are process, not zeroing to early test "$DM_DEV_DIR" != "/dev" && rm -rf "${mddev_pv%/*}" for dev in $(< MD_DEVICES); do mdadm --zero-superblock "$dev" || true - notify_lvmetad "$dev" done udev_wait if [ -b "$mddev" ]; then @@ -929,12 +866,6 @@ prepare_devs() { printf "%s\\n" "${DEVICES[@]}" > DEVICES # ( IFS=$'\n'; echo "${DEVICES[*]}" ) >DEVICES echo "ok" - - if test -e LOCAL_LVMETAD; then - for dev in "${DEVICES[@]}"; do - notify_lvmetad "$dev" - done - fi } @@ -1041,10 +972,6 @@ disable_dev() { dmsetup remove -f "$dev" 2>/dev/null || true fi done - - test -n "$silent" || for num in $notify; do - notify_lvmetad --major "${num%%:*}" --minor "${num##*:}" - done } enable_dev() { @@ -1066,10 +993,6 @@ enable_dev() { dmsetup resume "$name" done finish_udev_transaction - - test -n "$silent" || for dev in "$@"; do - notify_lvmetad "$dev" - done } # Throttle down performance of kcopyd when mirroring i.e. disk image @@ -1108,10 +1031,6 @@ restore_from_devtable() { dmsetup resume "$name" done finish_udev_transaction - - test -n "$silent" || for dev in "$@"; do - notify_lvmetad "$dev" - done } # @@ -1215,7 +1134,6 @@ generate_config() { fi LVM_TEST_LOCKING=${LVM_TEST_LOCKING:-1} - LVM_TEST_LVMETAD=${LVM_TEST_LVMETAD:-0} LVM_TEST_LVMPOLLD=${LVM_TEST_LVMPOLLD:-0} LVM_TEST_LVMLOCKD=${LVM_TEST_LVMLOCKD:-0} # FIXME:dct: This is harmful! Variables are unused here and are tested not being empty elsewhere: @@ -1264,7 +1182,6 @@ global/si_unit_consistency = 1 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" -global/use_lvmetad = $LVM_TEST_LVMETAD global/use_lvmpolld = $LVM_TEST_LVMPOLLD global/use_lvmlockd = $LVM_TEST_LVMLOCKD log/activation = 1 diff --git a/test/lib/flavour-ndev-lvmetad-lvmpolld.sh b/test/lib/flavour-ndev-lvmetad-lvmpolld.sh deleted file mode 100644 index 496b3bcff..000000000 --- a/test/lib/flavour-ndev-lvmetad-lvmpolld.sh +++ /dev/null @@ -1,3 +0,0 @@ -export LVM_TEST_LOCKING=1 -export LVM_TEST_LVMETAD=1 -export LVM_TEST_LVMPOLLD=1 diff --git a/test/lib/flavour-ndev-lvmetad.sh b/test/lib/flavour-ndev-lvmetad.sh deleted file mode 100644 index cb3c49e80..000000000 --- a/test/lib/flavour-ndev-lvmetad.sh +++ /dev/null @@ -1,2 +0,0 @@ -export LVM_TEST_LOCKING=1 -export LVM_TEST_LVMETAD=1 diff --git a/test/lib/flavour-udev-lvmetad-lvmpolld.sh b/test/lib/flavour-udev-lvmetad-lvmpolld.sh deleted file mode 100644 index 64253d1fa..000000000 --- a/test/lib/flavour-udev-lvmetad-lvmpolld.sh +++ /dev/null @@ -1,4 +0,0 @@ -export LVM_TEST_LOCKING=1 -export LVM_TEST_LVMETAD=1 -export LVM_TEST_LVMPOLLD=1 -export LVM_TEST_DEVDIR=/dev diff --git a/test/lib/flavour-udev-lvmetad.sh b/test/lib/flavour-udev-lvmetad.sh deleted file mode 100644 index 13be32ea2..000000000 --- a/test/lib/flavour-udev-lvmetad.sh +++ /dev/null @@ -1,3 +0,0 @@ -export LVM_TEST_LOCKING=1 -export LVM_TEST_LVMETAD=1 -export LVM_TEST_DEVDIR=/dev diff --git a/test/lib/flavour-udev-lvmlockd-test-lvmetad.sh b/test/lib/flavour-udev-lvmlockd-test-lvmetad.sh deleted file mode 100644 index d2a7b4af1..000000000 --- a/test/lib/flavour-udev-lvmlockd-test-lvmetad.sh +++ /dev/null @@ -1,9 +0,0 @@ -export LVM_TEST_LOCKING=1 -export LVM_TEST_LVMETAD=1 -export LVM_TEST_LVMPOLLD=1 -export LVM_TEST_LVMLOCKD=1 -export LVM_TEST_LVMLOCKD_TEST=1 -export LVM_TEST_DEVDIR=/dev - -# FIXME:dct: add option to allow --test with sanlock -export LVM_TEST_LVMLOCKD_TEST_DLM=1 diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh index 967fc1f66..a6cefa861 100644 --- a/test/lib/inittest.sh +++ b/test/lib/inittest.sh @@ -34,7 +34,6 @@ LVM_TEST_LVM1=${LVM_TEST_LVM1-} # TODO: LVM_TEST_SHARED SHARED=${SHARED-} -LVM_TEST_LVMETAD=${LVM_TEST_LVMETAD-} LVM_TEST_LVMLOCKD=${LVM_TEST_LVMLOCKD-} LVM_TEST_LVMLOCKD_TEST=${LVM_TEST_LVMLOCKD_TEST-} LVM_TEST_LVMPOLLD=${LVM_TEST_LVMPOLLD-} @@ -44,9 +43,6 @@ LVM_TEST_LOCK_TYPE_SANLOCK=${LVM_TEST_LOCK_TYPE_SANLOCK-} SKIP_WITHOUT_CLVMD=${SKIP_WITHOUT_CLVMD-} SKIP_WITH_CLVMD=${SKIP_WITH_CLVMD-} -SKIP_WITHOUT_LVMETAD=${SKIP_WITHOUT_LVMETAD-} -SKIP_WITH_LVMETAD=${SKIP_WITH_LVMETAD-} - SKIP_WITH_LVMPOLLD=${SKIP_WITH_LVMPOLLD-} SKIP_WITH_LVMLOCKD=${SKIP_WITH_LVMLOCKD-} SKIP_ROOT_DM_CHECK=${SKIP_ROOT_DM_CHECK-} @@ -58,9 +54,6 @@ test -f "lib/flavour-$LVM_TEST_FLAVOUR" || { echo "NOTE: Flavour '$LVM_TEST_FLAV test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && initskip test -n "$SKIP_WITH_CLVMD" && test "$LVM_TEST_LOCKING" = 3 && initskip -test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && initskip -test -n "$SKIP_WITH_LVMETAD" && test -n "$LVM_TEST_LVMETAD" && initskip - test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && test -z "$LVM_TEST_LVMLOCKD" && initskip test -n "$SKIP_WITH_LVMLOCKD" && test -n "$LVM_TEST_LVMLOCKD" && initskip @@ -68,7 +61,7 @@ test -n "$SKIP_WITH_LVMLOCKD" && test -n "$LVM_TEST_LVMLOCKD" && initskip unset CDPATH export LVM_TEST_BACKING_DEVICE LVM_TEST_DEVDIR LVM_TEST_NODEBUG -export LVM_TEST_LVMETAD LVM_TEST_LVMLOCKD LVM_TEST_LVMLOCKD_TEST +export LVM_TEST_LVMLOCKD LVM_TEST_LVMLOCKD_TEST export LVM_TEST_LVMPOLLD LVM_TEST_LOCK_TYPE_DLM LVM_TEST_LOCK_TYPE_SANLOCK # grab some common utilities . lib/utils @@ -157,15 +150,8 @@ test -n "$BASH" && set -euE -o pipefail echo "@TESTDIR=$TESTDIR" echo "@PREFIX=$PREFIX" -if test -n "$LVM_TEST_LVMETAD" ; then - export LVM_LVMETAD_SOCKET="$TESTDIR/lvmetad.socket" - export LVM_LVMETAD_PIDFILE="$TESTDIR/lvmetad.pid" - aux prepare_lvmetad -elif test -z "$SKIP_ROOT_DM_CHECK" ; then - # lvmetad prepares its own lvmconf - export LVM_LVMETAD_PIDFILE="$TESTDIR/non-existing-file" +if test -z "$SKIP_ROOT_DM_CHECK" ; then aux lvmconf - aux prepare_clvmd fi test -n "$LVM_TEST_LVMPOLLD" && { diff --git a/test/shell/dmsetup-integrity-keys.sh b/test/shell/dmsetup-integrity-keys.sh index 6a7172f58..cd98ead6d 100644 --- a/test/shell/dmsetup-integrity-keys.sh +++ b/test/shell/dmsetup-integrity-keys.sh @@ -13,8 +13,6 @@ # unrelated to lvm2 daemons SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 -SKIP_WITH_CLVMD=1 -SKIP_WITH_LVMETAD=1 . lib/inittest diff --git a/test/shell/dmsetup-keyring.sh b/test/shell/dmsetup-keyring.sh index 0f730a9fd..3c0b867e3 100644 --- a/test/shell/dmsetup-keyring.sh +++ b/test/shell/dmsetup-keyring.sh @@ -13,8 +13,6 @@ # unrelated to lvm2 daemons SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 -SKIP_WITH_CLVMD=1 -SKIP_WITH_LVMETAD=1 . lib/inittest diff --git a/test/shell/inconsistent-metadata.sh b/test/shell/inconsistent-metadata.sh index f5ccd137d..b42715de4 100644 --- a/test/shell/inconsistent-metadata.sh +++ b/test/shell/inconsistent-metadata.sh @@ -31,43 +31,36 @@ init() { aux restore_dev "$dev1" } -# vgscan fixes up metadata (needs --cache option for direct scan if lvmetad is used) -cache="" -test -e LOCAL_LVMETAD && cache="--cache" init -vgscan $cache 2>&1 | tee cmd.out +vgscan 2>&1 | tee cmd.out grep "Inconsistent metadata found for VG $vg" cmd.out -test -e LOCAL_LVMETAD && vgrename $vg foo && vgrename foo $vg # trigger a write -vgscan $cache 2>&1 | tee cmd.out +vgscan 2>&1 | tee cmd.out not grep "Inconsistent metadata found for VG $vg" cmd.out check lv_field $vg/resized lv_size "8.00m" -# only vgscan would have noticed metadata inconsistencies when lvmetad is active -if test ! -e LOCAL_LVMETAD; then - # vgdisplay fixes - init - vgdisplay $vg 2>&1 | tee cmd.out - grep "Inconsistent metadata found for VG $vg" cmd.out - vgdisplay $vg 2>&1 | tee cmd.out - not grep "Inconsistent metadata found for VG $vg" cmd.out - check lv_field $vg/resized lv_size "8.00m" +# vgdisplay fixes +init +vgdisplay $vg 2>&1 | tee cmd.out +grep "Inconsistent metadata found for VG $vg" cmd.out +vgdisplay $vg 2>&1 | tee cmd.out +not grep "Inconsistent metadata found for VG $vg" cmd.out +check lv_field $vg/resized lv_size "8.00m" - # lvs fixes up - init - lvs $vg 2>&1 | tee cmd.out - grep "Inconsistent metadata found for VG $vg" cmd.out - vgdisplay $vg 2>&1 | tee cmd.out - not grep "Inconsistent metadata found for VG $vg" cmd.out - check lv_field $vg/resized lv_size "8.00m" +# lvs fixes up +init +lvs $vg 2>&1 | tee cmd.out +grep "Inconsistent metadata found for VG $vg" cmd.out +vgdisplay $vg 2>&1 | tee cmd.out +not grep "Inconsistent metadata found for VG $vg" cmd.out +check lv_field $vg/resized lv_size "8.00m" - # vgs fixes up as well - init - vgs $vg 2>&1 | tee cmd.out - grep "Inconsistent metadata found for VG $vg" cmd.out - vgs $vg 2>&1 | tee cmd.out - not grep "Inconsistent metadata found for VG $vg" cmd.out - check lv_field $vg/resized lv_size "8.00m" -fi +# vgs fixes up as well +init +vgs $vg 2>&1 | tee cmd.out +grep "Inconsistent metadata found for VG $vg" cmd.out +vgs $vg 2>&1 | tee cmd.out +not grep "Inconsistent metadata found for VG $vg" cmd.out +check lv_field $vg/resized lv_size "8.00m" echo Check auto-repair of failed vgextend - metadata written to original pv but not new pv vgremove -f $vg @@ -77,7 +70,7 @@ aux backup_dev "$dev2" vgcreate $SHARED $vg "$dev1" vgextend $vg "$dev2" aux restore_dev "$dev2" -vgscan $cache +vgscan should check compare_fields vgs $vg vg_mda_count pvs "$dev2" vg_mda_count vgremove -ff $vg diff --git a/test/shell/lvconvert-mirror-basic.sh b/test/shell/lvconvert-mirror-basic.sh index 2378d48ff..81666139d 100644 --- a/test/shell/lvconvert-mirror-basic.sh +++ b/test/shell/lvconvert-mirror-basic.sh @@ -12,9 +12,6 @@ -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest log_name_to_count() { diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh index 87993dab1..8f37645b1 100644 --- a/test/shell/lvconvert-mirror.sh +++ b/test/shell/lvconvert-mirror.sh @@ -12,9 +12,6 @@ -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest aux prepare_pvs 5 diff --git a/test/shell/lvconvert-raid-status-validation.sh b/test/shell/lvconvert-raid-status-validation.sh index c5396d7ee..2d3b5b982 100644 --- a/test/shell/lvconvert-raid-status-validation.sh +++ b/test/shell/lvconvert-raid-status-validation.sh @@ -18,8 +18,6 @@ SKIP_WITH_LVMPOLLD=1 -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest # check for version 1.9.0 diff --git a/test/shell/lvconvert-raid-takeover-linear_to_raid4.sh b/test/shell/lvconvert-raid-takeover-linear_to_raid4.sh new file mode 100644 index 000000000..0360fa063 --- /dev/null +++ b/test/shell/lvconvert-raid-takeover-linear_to_raid4.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +# Copyright (C) 2018 Red Hat, Inc. All rights reserved. +# +# 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, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA + + +SKIP_WITH_LVMPOLLD=1 + +. lib/inittest + +which mkfs.ext4 || skip +aux have_raid 1 9 1 || skip + +aux prepare_vg 4 32 + +# FIXME: lvconvert leaks 'error' devices +detect_error_leak_() +{ + local err="" + + for i in $(dmsetup info -c -o name --noheadings) ; do + case "$i" in + "$vg*") (dmsetup table "$i" | grep "error ") && err="$err $i" ;; + esac + done + + test -z "$err" || { + dmsetup table | grep $vg + dmsetup ls --tree + die "Device(s) $err should not be here." + } +} + +# Create linear LV +lvcreate -y -L 9M -n $lv $vg +check lv_field $vg/$lv segtype "linear" +check lv_field $vg/$lv data_stripes 1 +check lv_field $vg/$lv stripes 1 +mkfs.ext4 "$DM_DEV_DIR/$vg/$lv" +fsck -fn "$DM_DEV_DIR/$vg/$lv" + +# Step 1: convert linear -> raid4 (convert to 2-legged raid1) +lvconvert -y --stripes 3 --ty raid4 $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid1" +check lv_field $vg/$lv data_stripes 2 +check lv_field $vg/$lv stripes 2 +aux wait_for_sync $vg $lv + +# Step 2: convert linear ->raid4 (convert to raid4) +lvconvert -y --stripes 3 --ty raid4 $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid4" +check lv_field $vg/$lv data_stripes 1 +check lv_field $vg/$lv stripes 2 + +# Step 3: convert linear ->raid4 (reshape to add stripes) +lvconvert -y --stripes 3 --ty raid4 $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid4" +check lv_field $vg/$lv data_stripes 3 +check lv_field $vg/$lv stripes 4 + +vgremove -ff $vg diff --git a/test/shell/lvconvert-raid-takeover-raid4_to_linear.sh b/test/shell/lvconvert-raid-takeover-raid4_to_linear.sh new file mode 100644 index 000000000..e571b82d1 --- /dev/null +++ b/test/shell/lvconvert-raid-takeover-raid4_to_linear.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +# Copyright (C) 2018 Red Hat, Inc. All rights reserved. +# +# 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, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA + + +SKIP_WITH_LVMPOLLD=1 + +. lib/inittest + +which mkfs.ext4 || skip +aux have_raid 1 9 1 || skip + +aux prepare_vg 4 32 + +# FIXME: lvconvert leaks 'error' devices +detect_error_leak_() +{ + local err="" + + for i in $(dmsetup info -c -o name --noheadings) ; do + case "$i" in + "$vg*") (dmsetup table "$i" | grep "error ") && err="$err $i" ;; + esac + done + + test -z "$err" || { + dmsetup table | grep $vg + dmsetup ls --tree + die "Device(s) $err should not be here." + } +} + +# Create 3-way striped raid4 (4 legs total) +lvcreate -y --ty raid4 --stripes 3 -L 9M -n $lv $vg +check lv_field $vg/$lv segtype "raid4" +check lv_field $vg/$lv data_stripes 3 +check lv_field $vg/$lv stripes 4 +mkfs.ext4 "$DM_DEV_DIR/$vg/$lv" +fsck -fn "$DM_DEV_DIR/$vg/$lv" + +# Step 1: grow before removing stripes +lvextend -y -L27M $vg/$lv +aux wait_for_sync $vg $lv + +# Step 2: convert raid4 -> linear (reshape to remove stripes) +lvconvert -y -f --ty linear $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid4" +check lv_field $vg/$lv data_stripes 1 +check lv_field $vg/$lv stripes 4 +aux wait_for_sync $vg $lv 1 + +# Step 2: convert raid4 -> linear (remove freed stripes) +lvconvert -y --ty linear $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid4" +check lv_field $vg/$lv data_stripes 1 +check lv_field $vg/$lv stripes 2 + +# Step 3: convert raid4 -> linear (convert to raid1) +lvconvert -y --ty linear $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "raid1" +check lv_field $vg/$lv data_stripes 2 +check lv_field $vg/$lv stripes 2 + +# Step 4: convert raid4 -> linear (convert to linear) +lvconvert -y --ty linear $vg/$lv +detect_error_leak_ +check lv_field $vg/$lv segtype "linear" +check lv_field $vg/$lv data_stripes 1 +check lv_field $vg/$lv stripes 1 + +vgremove -ff $vg diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh index d1c5d305b..d22c11b0c 100644 --- a/test/shell/lvconvert-raid-takeover.sh +++ b/test/shell/lvconvert-raid-takeover.sh @@ -108,11 +108,19 @@ function _invalid_raid5_conversions not _lvconvert raid6 raid6_n_6 4 6 $vg $lv1 } -# Check raid6 conversion constrainst of minimum 3 stripes -_lvcreate striped 2 2 4m $vg $lv1 -not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1 -lvremove -y $vg +# Check raid6 conversion constrainst for 2 stripes +for type in striped raid0 raid0_meta +do + _lvcreate $type 2 2 4m $vg $lv1 + not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1 + _lvconvert raid6 raid5_n 2 3 $vg $lv1 + _lvconvert raid6 raid5_n 3 4 $vg $lv1 + _lvconvert raid6 raid6_n_6 3 5 $vg $lv1 + lvremove -y $vg +done + +# Check raid6 conversion constrainst of minimum 3 stripes _lvcreate raid0 3 3 4m $vg $lv1 _lvconvert raid6 raid6_n_6 3 5 $vg $lv1 lvremove -y $vg diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh index ce60b6b0d..3b7af9750 100644 --- a/test/shell/lvconvert-raid.sh +++ b/test/shell/lvconvert-raid.sh @@ -14,8 +14,6 @@ SKIP_WITH_LVMPOLLD=1 -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest get_image_pvs() { diff --git a/test/shell/lvcreate-repair.sh b/test/shell/lvcreate-repair.sh index cff001827..07263a328 100644 --- a/test/shell/lvcreate-repair.sh +++ b/test/shell/lvcreate-repair.sh @@ -88,7 +88,6 @@ dd if=backup_i of="$dev1" bs=256K count=1 # dirty game dd if=/dev/zero of="$dev3" bs=256K count=1 -aux notify_lvmetad "$dev3" # udev be watching you vgreduce --removemissing --force $vg diff --git a/test/shell/mirror-vgreduce-removemissing.sh b/test/shell/mirror-vgreduce-removemissing.sh index 69d9fe872..d95a0ac7b 100644 --- a/test/shell/mirror-vgreduce-removemissing.sh +++ b/test/shell/mirror-vgreduce-removemissing.sh @@ -15,9 +15,6 @@ test_description="ensure that 'vgreduce --removemissing' works on mirrored LV" SKIP_WITH_LVMPOLLD=1 -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest list_pvs=() diff --git a/test/shell/name-mangling.sh b/test/shell/name-mangling.sh index 8382ad1ef..4287939a2 100644 --- a/test/shell/name-mangling.sh +++ b/test/shell/name-mangling.sh @@ -13,8 +13,6 @@ # This test is not using any lvm command # so skip duplicate CLMVD and lvmetad test -SKIP_WITH_CLVMD=1 -SKIP_WITH_LVMETAD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest diff --git a/test/shell/pool-labels.sh b/test/shell/pool-labels.sh index 3f9b9424d..88978e8e4 100644 --- a/test/shell/pool-labels.sh +++ b/test/shell/pool-labels.sh @@ -10,9 +10,6 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# lvmetad does not handle pool labels so skip test. - -SKIP_WITH_LVMETAD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest @@ -27,7 +24,6 @@ create_pool_label_() # printf comes from coreutils, and is probably not posix either env printf "\x01\x16\x70\x06\x5f\xcf\xff\xb9\xf8\x24\x8apool1" | dd of="$2" bs=5 seek=1 conv=notrunc env printf "\x04\x01\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0$1\x68\x01\x16\x70\x00\x00\x00\x00\x00\x06\x5f\xd0" | dd of=$2 bs=273 seek=1 conv=notrunc - aux notify_lvmetad "$2" } diff --git a/test/shell/process-each-lv.sh b/test/shell/process-each-lv.sh index 9482a0847..f28988c63 100644 --- a/test/shell/process-each-lv.sh +++ b/test/shell/process-each-lv.sh @@ -14,9 +14,6 @@ test_description='Exercise toollib process_each_lv' SKIP_WITH_LVMPOLLD=1 -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest diff --git a/test/shell/pv-duplicate-uuid.sh b/test/shell/pv-duplicate-uuid.sh index a07681213..37d851401 100644 --- a/test/shell/pv-duplicate-uuid.sh +++ b/test/shell/pv-duplicate-uuid.sh @@ -20,15 +20,11 @@ aux prepare_devs 3 pvcreate "$dev1" UUID1=$(get pv_field "$dev1" uuid) -pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]} global/use_lvmetad=0" -u "$UUID1" --norestorefile "$dev2" -pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]} global/use_lvmetad=0" -u "$UUID1" --norestorefile "$dev3" +pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev2" +pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev3" pvscan --cache 2>&1 | tee out -if test -e LOCAL_LVMETAD; then - grep "WARNING: Disabling lvmetad cache which does not support duplicate PVs." out -fi - pvs -o+uuid 2>&1 | tee out grep WARNING out > warn || true diff --git a/test/shell/pv-ext-update.sh b/test/shell/pv-ext-update.sh index 9059a226c..bd66c02ca 100644 --- a/test/shell/pv-ext-update.sh +++ b/test/shell/pv-ext-update.sh @@ -10,7 +10,6 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# lvmetad does not handle pool labels so skip test. SKIP_WITH_LVMPOLLD=1 @@ -166,8 +165,6 @@ create_pv_with_ext_vsn1_and_vg() "\x75\x6c\x20\x32\x37\x20\x31\x31\x3a\x32\x35\x3a\x31\x30\x20\x32"\ "\x30\x31\x36\x0a\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"\ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" | dd of="$1" bs=5632 seek=1 conv=notrunc - - aux notify_lvmetad "$1" } aux prepare_devs 1 8 diff --git a/test/shell/pvmove-basic.sh b/test/shell/pvmove-basic.sh index 2fc71e27a..c02354d89 100644 --- a/test/shell/pvmove-basic.sh +++ b/test/shell/pvmove-basic.sh @@ -15,9 +15,6 @@ test_description="ensure that pvmove works with basic options" SKIP_WITH_LVMLOCKD=1 -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest which md5sum || skip diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh index dcf4c3792..115ce1499 100644 --- a/test/shell/pvmove-restart.sh +++ b/test/shell/pvmove-restart.sh @@ -81,8 +81,6 @@ if test -e LOCAL_CLVMD ; then aux prepare_clvmd fi -aux notify_lvmetad "$dev1" "$dev2" "$dev3" - # Only PVs should be left in table... dmsetup table diff --git a/test/shell/pvmove-resume-1.sh b/test/shell/pvmove-resume-1.sh index ddebcb90b..6b4cbe529 100644 --- a/test/shell/pvmove-resume-1.sh +++ b/test/shell/pvmove-resume-1.sh @@ -86,8 +86,6 @@ test_pvmove_resume() { aux prepare_clvmd fi - aux notify_lvmetad "$dev1" "$dev2" "$dev3" "$dev4" - # call resume function (see below) # with expected number of spawned # bg polling as parameter diff --git a/test/shell/pvmove-resume-2.sh b/test/shell/pvmove-resume-2.sh index 5e9ad8124..803e6ef64 100644 --- a/test/shell/pvmove-resume-2.sh +++ b/test/shell/pvmove-resume-2.sh @@ -75,8 +75,6 @@ test_pvmove_resume() { aux prepare_clvmd fi - aux notify_lvmetad "$dev1" "$dev2" - # call resume function (see below) # with expected number of spawned # bg polling as parameter diff --git a/test/shell/pvmove-resume-multiseg.sh b/test/shell/pvmove-resume-multiseg.sh index ce54061d3..89c2f74f6 100644 --- a/test/shell/pvmove-resume-multiseg.sh +++ b/test/shell/pvmove-resume-multiseg.sh @@ -16,7 +16,6 @@ # Multisegment variant w/ 2 pvmoves LVs per VG SKIP_WITH_LVMLOCKD=1 -SKIP_WITH_CLVMD=1 . lib/inittest @@ -79,8 +78,6 @@ test_pvmove_resume() { aux prepare_clvmd fi - aux notify_lvmetad "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" - # call resume function (see below) # with expected number of spawned # bg polling as parameter diff --git a/test/shell/relative-sign-options.sh b/test/shell/relative-sign-options.sh index 82a5ed2d0..833399815 100644 --- a/test/shell/relative-sign-options.sh +++ b/test/shell/relative-sign-options.sh @@ -13,10 +13,6 @@ test_description='Exercise toollib process_each_lv' SKIP_WITH_LVMPOLLD=1 - -# disable lvmetad logging as it bogs down test systems -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest aux prepare_vg 1 256 diff --git a/test/shell/report-fields.sh b/test/shell/report-fields.sh index 82606107c..949e5a579 100644 --- a/test/shell/report-fields.sh +++ b/test/shell/report-fields.sh @@ -11,9 +11,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -SKIP_WITH_LVMETAD=1 SKIP_WITH_LVMPOLLD=1 -SKIP_WITH_CLVMD=1 . lib/inittest diff --git a/test/shell/report-hidden.sh b/test/shell/report-hidden.sh index 24a11c8f1..621eefc54 100644 --- a/test/shell/report-hidden.sh +++ b/test/shell/report-hidden.sh @@ -11,8 +11,6 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -SKIP_WITH_LVMETAD=1 -SKIP_WITH_CLVMD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest diff --git a/test/shell/snapshot-remove-dmsetup.sh b/test/shell/snapshot-remove-dmsetup.sh index a7925d5d5..19411ce93 100644 --- a/test/shell/snapshot-remove-dmsetup.sh +++ b/test/shell/snapshot-remove-dmsetup.sh @@ -13,8 +13,6 @@ # check if 'dmsetup --noflush' will work properly for mounted snapshot SKIP_WITH_LVMLOCKD=1 -SKIP_WITH_CLVMD=1 -SKIP_WITH_LVMETAD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest diff --git a/test/shell/system_id.sh b/test/shell/system_id.sh index ec7953d1c..8814d5497 100644 --- a/test/shell/system_id.sh +++ b/test/shell/system_id.sh @@ -27,22 +27,6 @@ aux prepare_devs 1 SIDFILE="etc/lvm_test.conf" LVMLOCAL="etc/lvmlocal.conf" -# with clvm enabled, vgcreate with no -c option creates a clustered vg, -# which should have no system id - -if [ -e LOCAL_CLVMD ]; then -SID1=sidfoolocal -SID2="" -print_lvmlocal " system_id = $SID1" -aux lvmconf "global/system_id_source = lvmlocal" -vgcreate $vg1 "$dev1" -vgs -o+systemid $vg1 -check vg_field $vg1 systemid "$SID2" -vgremove $vg1 -rm -f "$LVMLOCAL" -exit 0 -fi - # create vg with system_id using each source ## none @@ -596,184 +580,3 @@ check vg_field $vg1 systemid "$SID" grep "No system ID found from system_id_source" err vgremove $vg1 - -# Test cases where lvmetad cache of a foreign VG are out of date -# because the foreign owner has changed the VG. - -test ! -e LOCAL_LVMETAD && exit 0 - -# When a foreign vg is newer on disk than in lvmetad, using --foreign -# should find the newer version. This simulates a foreign host changing -# foreign vg by turning off lvmetad when we create an lv in the vg. -SID1=sidfoofile1 -SID2=sidfoofile2 -echo "$SID1" > "$SIDFILE" -aux lvmconf "global/system_id_source = file" \ - "global/system_id_file = \"$SIDFILE\"" -# create a vg with an lv -vgcreate $vg1 "$dev1" -lvcreate -n $lv1 -l 2 -an $vg1 -# normal vgs sees the vg and lv -vgs >err -grep $vg1 err -check lv_exists $vg1 $lv1 -# go around lvmetad to create another lv in the vg, -# forcing the lvmetad copy to be older than on disk. -aux lvmconf 'global/use_lvmetad = 0' -lvcreate -n $lv2 -l 2 -an $vg1 -aux lvmconf 'global/use_lvmetad = 1' -# verify that the second lv is not in lvmetad -lvs $vg1 >err -grep $lv1 err -not grep $lv2 err -# change our system_id, making the vg foreign -echo "$SID2" > "$SIDFILE" -vgs >err -not grep $vg1 err -# using --foreign, we will get the latest vg from disk -lvs --foreign $vg1 >err -grep $vg1 err -grep $lv1 err -grep $lv2 err -# change our system_id back to match the vg so it's not foreign -echo "$SID1" > "$SIDFILE" -lvremove $vg1/$lv1 -lvremove $vg1/$lv2 -vgremove $vg1 - -# vgimport should find the exported vg on disk even though -# lvmetad's copy of the vg shows it's foreign. -SID1=sidfoofile1 -SID2=sidfoofile2 -echo "$SID1" > "$SIDFILE" -aux lvmconf "global/system_id_source = file" \ - "global/system_id_file = \"$SIDFILE\"" -# create a vg with an lv -vgcreate $vg1 "$dev1" -lvcreate -n $lv1 -l 2 -an $vg1 -# normal vgs sees the vg and lv -vgs >err -grep $vg1 err -check lv_exists $vg1 $lv1 -# go around lvmetad to export the vg so that lvmetad still -# has the original vg owned by SID1 in its cache -aux lvmconf 'global/use_lvmetad = 0' -vgexport $vg1 -aux lvmconf 'global/use_lvmetad = 1' -# change the local system_id so the lvmetad copy of the vg is foreign -echo "$SID2" > "$SIDFILE" -# verify that lvmetad thinks the vg is foreign -# (don't use --foreign to verify this because that will cause -# the lvmetad cache to be updated, which we don't want yet) -not vgs $vg1 -# attempt to import the vg that has been exported, but -# which lvmetad thinks is foreign -vgimport $vg1 -# verify that the imported vg has our system_id -vgs -o+systemid $vg1 >err -grep $vg1 err -grep $SID2 err -check lv_exists $vg1 $lv1 -lvremove $vg1/$lv1 -vgremove $vg1 -rm -f "$SIDFILE" - -# pvscan --cache should cause the latest version of a foreign VG to be -# cached in lvmetad. Without the --cache option, pvscan will see the old -# version of the VG. -SID1=sidfoofile1 -SID2=sidfoofile2 -echo "$SID1" > "$SIDFILE" -aux lvmconf "global/system_id_source = file" \ - "global/system_id_file = \"$SIDFILE\"" -# create a vg with an lv -vgcreate $vg1 "$dev1" -lvcreate -n $lv1 -l 2 -an $vg1 -# normal vgs sees the vg and lv -vgs >err -grep $vg1 err -check lv_exists $vg1 $lv1 -# go around lvmetad to create another lv in the vg, -# forcing the lvmetad copy to be older than on disk. -aux lvmconf 'global/use_lvmetad = 0' -lvcreate -n $lv2 -l 2 -an $vg1 -aux lvmconf 'global/use_lvmetad = 1' -# verify that the second lv is not in lvmetad -lvs $vg1 >err -grep $lv1 err -not grep $lv2 err -# verify that after pvscan without --cache, lvmetad still -# reports the old version -pvscan -lvs $vg1 >err -grep $lv1 err -not grep $lv2 err -# change our system_id, making the vg foreign -echo "$SID2" > "$SIDFILE" -not vgs $vg1 >err -not grep $vg1 err -# use pvscan --cache to update the foreign vg in lvmetad -pvscan --cache -not vgs $vg1 >err -not grep $vg1 err -# change our system_id back to SID1 so we can check that -# lvmetad has the latest copy of the vg (without having -# to use --foreign to check) -echo "$SID1" > "$SIDFILE" -vgs $vg1 >err -grep $vg1 err -lvs $vg1 >err -grep $lv1 err -grep $lv2 err -lvremove $vg1/$lv1 -lvremove $vg1/$lv2 -vgremove $vg1 - -# repeat the same test for vgscan instead of pvscan -SID1=sidfoofile1 -SID2=sidfoofile2 -echo "$SID1" > "$SIDFILE" -aux lvmconf "global/system_id_source = file" \ - "global/system_id_file = \"$SIDFILE\"" -# create a vg with an lv -vgcreate $vg1 "$dev1" -lvcreate -n $lv1 -l 2 -an $vg1 -# normal vgs sees the vg and lv -vgs >err -grep $vg1 err -check lv_exists $vg1 $lv1 -# go around lvmetad to create another lv in the vg, -# forcing the lvmetad copy to be older than on disk. -aux lvmconf 'global/use_lvmetad = 0' -lvcreate -n $lv2 -l 2 -an $vg1 -aux lvmconf 'global/use_lvmetad = 1' -# verify that the second lv is not in lvmetad -lvs $vg1 >err -grep $lv1 err -not grep $lv2 err -# verify that after vgscan without --cache, lvmetad still -# reports the old version -vgscan -lvs $vg1 >err -grep $lv1 err -not grep $lv2 err -# change our system_id, making the vg foreign -echo "$SID2" > "$SIDFILE" -not vgs $vg1 >err -not grep $vg1 err -# use vgscan --cache to update the foreign vg in lvmetad -vgscan --cache -not vgs $vg1 >err -not grep $vg1 err -# change our system_id back to SID1 so we can check that -# lvmetad has the latest copy of the vg (without having -# to use --foreign to check) -echo "$SID1" > "$SIDFILE" -vgs $vg1 >err -grep $vg1 err -lvs $vg1 >err -grep $lv1 err -grep $lv2 err -lvremove $vg1/$lv1 -lvremove $vg1/$lv2 -vgremove $vg1 diff --git a/test/shell/test-partition.sh b/test/shell/test-partition.sh index 083cd9877..0e92f00db 100644 --- a/test/shell/test-partition.sh +++ b/test/shell/test-partition.sh @@ -32,5 +32,4 @@ pvs "$dev1" # create small partition table echo "1 2" | sfdisk --force "$dev1" -aux notify_lvmetad "$dev1" not pvs "$dev1" diff --git a/test/shell/thin-dmeventd-warns.sh b/test/shell/thin-dmeventd-warns.sh index a8002ae99..2e97fb1d8 100644 --- a/test/shell/thin-dmeventd-warns.sh +++ b/test/shell/thin-dmeventd-warns.sh @@ -14,8 +14,6 @@ SKIP_WITH_LVMPOLLD=1 -SKIP_WITH_CLVMD=1 -SKIP_WITH_LVMETAD=1 . lib/inittest diff --git a/test/shell/vgchange-many.sh b/test/shell/vgchange-many.sh index debfdc4c3..389877ab8 100644 --- a/test/shell/vgchange-many.sh +++ b/test/shell/vgchange-many.sh @@ -16,8 +16,6 @@ SKIP_WITH_LVMPOLLD=1 . lib/inittest -# FIXME: lvmetad fails with i.e. 1500 device on memory failure... - # Number of LVs to create TEST_DEVS=1000 # On low-memory boxes let's not stress too much diff --git a/test/shell/vgck.sh b/test/shell/vgck.sh index c9d29bb3b..3288d1ba6 100644 --- a/test/shell/vgck.sh +++ b/test/shell/vgck.sh @@ -24,14 +24,9 @@ dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" vgscan 2>&1 | tee vgscan.out || true -if test -e LOCAL_LVMETAD; then - not grep "Failed" vgscan.out -else - grep "Failed" vgscan.out -fi +grep "Failed" vgscan.out dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" -aux notify_lvmetad "$dev2" vgck $vg 2>&1 | tee vgck.out || true grep Incorrect vgck.out diff --git a/test/shell/vgcreate-many-pvs.sh b/test/shell/vgcreate-many-pvs.sh index 9598f915e..c68afeb22 100644 --- a/test/shell/vgcreate-many-pvs.sh +++ b/test/shell/vgcreate-many-pvs.sh @@ -26,12 +26,10 @@ SKIP_WITH_LVMPOLLD=1 # export LVM_TEST_PVS=300 # # make check_local ~52sec (U:29s, S:13s) -# make check_lvmetad ~20sec (U: 4s, S: 5s) # # With patch from 2015-03-06: # # make check_local ~30sec (U:10s, S:12s) -# make check_lvmetad ~20sec (U: 4s, S: 5s) # # TODO: extend test suite to monitor performance and report regressions... diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh index 48a666e4a..2245d65eb 100644 --- a/test/shell/vgimportclone.sh +++ b/test/shell/vgimportclone.sh @@ -45,7 +45,6 @@ vgchange -ay $vg1 # Clone the LUN dd if="$dev1" of="$dev2" bs=256K count=1 -aux notify_lvmetad "$dev2" # Verify pvs works on each device to give us vgname aux hide_dev "$dev2" @@ -59,14 +58,6 @@ aux unhide_dev "$dev1" # Import the cloned PV to a new VG vgimportclone --basevgname $vg2 "$dev2" -# We need to re-scan *both* $dev1 and $dev2 since a PV, as far as lvmetad is -# concerned, can only live on a single device. With the last pvscan, we told it -# that PV from $dev1 now lives on $dev2, but in fact this is not true anymore, -# since we wrote a different PV over $dev2. -rm -f "$TESTDIR/etc/.cache" -aux notify_lvmetad "$dev2" -aux notify_lvmetad "$dev1" - # Verify we can activate / deactivate the LV from both VGs lvchange -ay $vg1/$lv1 $vg2/$lv1 vgchange -an $vg1 $vg2 @@ -79,19 +70,16 @@ vgcreate $SHARED --metadatasize 128k A${vg1}B "$dev1" # vg1B is not the same as Avg1B - we don't need number suffix dd if="$dev1" of="$dev2" bs=256K count=1 -aux notify_lvmetad "$dev2" vgimportclone -n ${vg1}B "$dev2" check pv_field "$dev2" vg_name ${vg1}B # Avg1 is not the same as Avg1B - we don't need number suffix dd if="$dev1" of="$dev2" bs=256K count=1 -aux notify_lvmetad "$dev2" vgimportclone -n A${vg1} "$dev2" check pv_field "$dev2" vg_name A${vg1} # Avg1B is the same as Avg1B - we need to add the number suffix dd if="$dev1" of="$dev2" bs=256K count=1 -aux notify_lvmetad "$dev2" vgimportclone -n A${vg1}B "$dev2" aux vgs check pv_field "$dev2" vg_name A${vg1}B1 diff --git a/test/shell/vgremove-corrupt-vg.sh b/test/shell/vgremove-corrupt-vg.sh index 1de77e4db..3b1774664 100644 --- a/test/shell/vgremove-corrupt-vg.sh +++ b/test/shell/vgremove-corrupt-vg.sh @@ -19,6 +19,5 @@ aux prepare_vg 3 lvcreate -n blabla -L 1 $vg -an --zero n dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" -aux notify_lvmetad "$dev2" vgremove -f $vg diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh index 2ec140b5b..ab88866b9 100644 --- a/test/shell/vgsplit-operation.sh +++ b/test/shell/vgsplit-operation.sh @@ -12,12 +12,9 @@ # Test vgsplit operation, including different LV types -# disable lvmetad logging as it bogs down test systems SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 -export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-} - . lib/inittest COMM() { diff --git a/test/unit/Makefile b/test/unit/Makefile index c2f992bc0..bf8535470 100644 --- a/test/unit/Makefile +++ b/test/unit/Makefile @@ -45,7 +45,7 @@ run-unit-test: test/unit/unit-test ifeq ("$(USE_TRACKING)","yes") ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \ - help check check_local check_cluster check_lvmetad check_lvmpolld run-unit-test)) + help check check_local check_lvmpolld run-unit-test)) -include $(UNIT_DEPENDS) endif endif diff --git a/test/unit/unit-test.sh b/test/unit/unit-test.sh index e8332d62d..f545f1490 100644 --- a/test/unit/unit-test.sh +++ b/test/unit/unit-test.sh @@ -13,8 +13,6 @@ SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 -SKIP_WITH_LVMETAD=1 -SKIP_WITH_CLVMD=1 SKIP_ROOT_DM_CHECK=1